refactor: Set default process Mode based on Settings type if we are INI Type we in desktop mode if Native (only on windows) we default to Service
This commit is contained in:
parent
1b8067797e
commit
d9807a2693
2 changed files with 8 additions and 9 deletions
|
|
@ -109,8 +109,9 @@ QVariant Settings::defaultValue(const QString &key)
|
|||
if (key == Server::Binary)
|
||||
return kServerBinName;
|
||||
|
||||
if (key == Core::ElevateMode)
|
||||
if (key == Core::ElevateMode) {
|
||||
return Settings::ElevateMode::Always;
|
||||
}
|
||||
|
||||
if (key == Core::UpdateUrl)
|
||||
return kUrlUpdateCheck;
|
||||
|
|
@ -121,8 +122,12 @@ QVariant Settings::defaultValue(const QString &key)
|
|||
if (key == Core::Port)
|
||||
return 24800;
|
||||
|
||||
if (key == Core::ProcessMode)
|
||||
return defaultProcessMode;
|
||||
if (key == Core::ProcessMode) {
|
||||
if (instance()->isNativeMode())
|
||||
return Settings::ProcessMode::Service;
|
||||
else
|
||||
return Settings::ProcessMode::Desktop;
|
||||
}
|
||||
|
||||
if (key == Daemon::LogFile) {
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
|
|||
|
|
@ -213,10 +213,4 @@ private:
|
|||
, Settings::Server::ExternalConfigFile
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
inline static const auto defaultProcessMode = Settings::ProcessMode::Service;
|
||||
#else
|
||||
inline static const auto defaultProcessMode = Settings::ProcessMode::Desktop;
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue