Use default value for InitiateConnectionFromServer option during switching between scopes (#7232)

This commit is contained in:
Serhii Hadzhilov 2022-10-12 19:32:06 +03:00 committed by GitHub
parent b2b887cf43
commit 88fdd26350
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -577,10 +577,11 @@ QVariant AppConfig::loadCommonSetting(AppConfig::Setting name, const QVariant& d
return result;
}
void AppConfig::loadScope(ConfigWriter::Scope scope) const {
void AppConfig::loadScope(ConfigWriter::Scope scope) {
auto writer = ConfigWriter::make();
if (writer->getScope() != scope) {
setDefaultValues();
writer->setScope(scope);
if (writer->hasSetting(settingName(kScreenName), writer->getScope())) {
//If the user already has settings, then load them up now.
@ -589,6 +590,11 @@ void AppConfig::loadScope(ConfigWriter::Scope scope) const {
}
}
void AppConfig::setDefaultValues()
{
m_InitiateConnectionFromServer = false;
}
void AppConfig::setLoadFromSystemScope(bool value) {
if (value) {

View file

@ -344,7 +344,11 @@ protected:
/// @brief This method loads config from specified scope
/// @param [in] scope which should be loaded.
void loadScope(GUI::Config::ConfigWriter::Scope scope) const;
void loadScope(GUI::Config::ConfigWriter::Scope scope);
/// @brief This function sets default values
/// for settings that shouldn't be copied from between scopes.
void setDefaultValues();
signals:
void sslToggled() const;