mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-28 03:36:20 +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) {
|
static inline shared_ptr<linphone::Config> getConfigIfExists (const QCommandLineParser &parser) {
|
||||||
string configPath = Paths::getConfigFilePath(parser.value("config"), false);
|
shared_ptr<linphone::Config> config;
|
||||||
if (Paths::filePathExists(configPath))
|
|
||||||
return linphone::Config::newWithFactory(configPath, "");
|
|
||||||
|
|
||||||
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");
|
mustBeIconified = mParser->isSet("iconified");
|
||||||
|
|
||||||
|
mColors = new Colors(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Change colors if necessary.
|
||||||
|
mColors->useConfig(config);
|
||||||
|
|
||||||
// Init core.
|
// Init core.
|
||||||
CoreManager::init(this, mParser->value("config"));
|
CoreManager::init(this, mParser->value("config"));
|
||||||
|
|
||||||
|
|
@ -219,9 +230,6 @@ void App::initContentApp () {
|
||||||
mEngine->addImageProvider(ImageProvider::ProviderId, new ImageProvider());
|
mEngine->addImageProvider(ImageProvider::ProviderId, new ImageProvider());
|
||||||
mEngine->addImageProvider(ThumbnailProvider::ProviderId, new ThumbnailProvider());
|
mEngine->addImageProvider(ThumbnailProvider::ProviderId, new ThumbnailProvider());
|
||||||
|
|
||||||
mColors = new Colors(this);
|
|
||||||
mColors->useConfig(config);
|
|
||||||
|
|
||||||
registerTypes();
|
registerTypes();
|
||||||
registerSharedTypes();
|
registerSharedTypes();
|
||||||
registerToolTypes();
|
registerToolTypes();
|
||||||
|
|
@ -595,13 +603,11 @@ void App::openAppAfterInit (bool mustBeIconified) {
|
||||||
#endif // ifndef __APPLE__
|
#endif // ifndef __APPLE__
|
||||||
|
|
||||||
// Display Assistant if it's the first time app launch.
|
// Display Assistant if it's the first time app launch.
|
||||||
{
|
shared_ptr<linphone::Config> config(CoreManager::getInstance()->getCore()->getConfig());
|
||||||
shared_ptr<linphone::Config> config = CoreManager::getInstance()->getCore()->getConfig();
|
|
||||||
if (config->getInt(SettingsModel::UiSection, "force_assistant_at_startup", 1)) {
|
if (config->getInt(SettingsModel::UiSection, "force_assistant_at_startup", 1)) {
|
||||||
QMetaObject::invokeMethod(mainWindow, "setView", Q_ARG(QVariant, "Assistant"), Q_ARG(QVariant, QString("")));
|
QMetaObject::invokeMethod(mainWindow, "setView", Q_ARG(QVariant, "Assistant"), Q_ARG(QVariant, QString("")));
|
||||||
config->setInt(SettingsModel::UiSection, "force_assistant_at_startup", 0);
|
config->setInt(SettingsModel::UiSection, "force_assistant_at_startup", 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef ENABLE_UPDATE_CHECK
|
#ifdef ENABLE_UPDATE_CHECK
|
||||||
QTimer *timer = new QTimer(mEngine);
|
QTimer *timer = new QTimer(mEngine);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue