mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-19 12:28:08 +00:00
fix(App): use factory file in getConfigIfExists, useful to override correctly colors for the first time
This commit is contained in:
parent
23fe2478f9
commit
fd82d4e1ce
1 changed files with 19 additions and 13 deletions
|
|
@ -73,11 +73,17 @@ static inline bool installLocale (App &app, QTranslator &translator, const QLoca
|
|||
}
|
||||
|
||||
static inline shared_ptr<linphone::Config> getConfigIfExists (const QCommandLineParser &parser) {
|
||||
string configPath = Paths::getConfigFilePath(parser.value("config"), false);
|
||||
if (Paths::filePathExists(configPath))
|
||||
return linphone::Config::newWithFactory(configPath, "");
|
||||
shared_ptr<linphone::Config> config;
|
||||
|
||||
return nullptr;
|
||||
string configPath(Paths::getConfigFilePath(parser.value("config"), false));
|
||||
if (!Paths::filePathExists(configPath))
|
||||
configPath.clear();
|
||||
|
||||
string factoryPath(Paths::getFactoryConfigFilePath());
|
||||
if (!Paths::filePathExists(factoryPath))
|
||||
factoryPath.clear();
|
||||
|
||||
return linphone::Config::newWithFactory(configPath, factoryPath);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
@ -180,8 +186,13 @@ void App::initContentApp () {
|
|||
});
|
||||
|
||||
mustBeIconified = mParser->isSet("iconified");
|
||||
|
||||
mColors = new Colors(this);
|
||||
}
|
||||
|
||||
// Change colors if necessary.
|
||||
mColors->useConfig(config);
|
||||
|
||||
// Init core.
|
||||
CoreManager::init(this, mParser->value("config"));
|
||||
|
||||
|
|
@ -219,9 +230,6 @@ void App::initContentApp () {
|
|||
mEngine->addImageProvider(ImageProvider::ProviderId, new ImageProvider());
|
||||
mEngine->addImageProvider(ThumbnailProvider::ProviderId, new ThumbnailProvider());
|
||||
|
||||
mColors = new Colors(this);
|
||||
mColors->useConfig(config);
|
||||
|
||||
registerTypes();
|
||||
registerSharedTypes();
|
||||
registerToolTypes();
|
||||
|
|
@ -595,12 +603,10 @@ void App::openAppAfterInit (bool mustBeIconified) {
|
|||
#endif // ifndef __APPLE__
|
||||
|
||||
// Display Assistant if it's the first time app launch.
|
||||
{
|
||||
shared_ptr<linphone::Config> config = CoreManager::getInstance()->getCore()->getConfig();
|
||||
if (config->getInt(SettingsModel::UiSection, "force_assistant_at_startup", 1)) {
|
||||
QMetaObject::invokeMethod(mainWindow, "setView", Q_ARG(QVariant, "Assistant"), Q_ARG(QVariant, QString("")));
|
||||
config->setInt(SettingsModel::UiSection, "force_assistant_at_startup", 0);
|
||||
}
|
||||
shared_ptr<linphone::Config> config(CoreManager::getInstance()->getCore()->getConfig());
|
||||
if (config->getInt(SettingsModel::UiSection, "force_assistant_at_startup", 1)) {
|
||||
QMetaObject::invokeMethod(mainWindow, "setView", Q_ARG(QVariant, "Assistant"), Q_ARG(QVariant, QString("")));
|
||||
config->setInt(SettingsModel::UiSection, "force_assistant_at_startup", 0);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_UPDATE_CHECK
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue