Commit f9c4eb12 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(App): when app is restarted, update language if necessary

parent e1b11522
...@@ -142,6 +142,8 @@ inline void activeSplashScreen (QQmlApplicationEngine *engine) { ...@@ -142,6 +142,8 @@ inline void activeSplashScreen (QQmlApplicationEngine *engine) {
} }
void App::initContentApp () { void App::initContentApp () {
shared_ptr<linphone::Config> config = ::getConfigIfExists(*mParser);
// Destroy qml components and linphone core if necessary. // Destroy qml components and linphone core if necessary.
if (mEngine) { if (mEngine) {
qInfo() << QStringLiteral("Restarting app..."); qInfo() << QStringLiteral("Restarting app...");
...@@ -151,6 +153,8 @@ void App::initContentApp () { ...@@ -151,6 +153,8 @@ void App::initContentApp () {
mSettingsWindow = nullptr; mSettingsWindow = nullptr;
CoreManager::uninit(); CoreManager::uninit();
initLocale(config);
} else { } else {
// Don't quit if last window is closed!!! // Don't quit if last window is closed!!!
setQuitOnLastWindowClosed(false); setQuitOnLastWindowClosed(false);
...@@ -185,7 +189,7 @@ void App::initContentApp () { ...@@ -185,7 +189,7 @@ void App::initContentApp () {
mEngine->addImageProvider(ThumbnailProvider::PROVIDER_ID, new ThumbnailProvider()); mEngine->addImageProvider(ThumbnailProvider::PROVIDER_ID, new ThumbnailProvider());
mColors = new Colors(this); mColors = new Colors(this);
mColors->useConfig(::getConfigIfExists(*mParser)); mColors->useConfig(config);
registerTypes(); registerTypes();
registerSharedTypes(); registerSharedTypes();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment