summaryrefslogtreecommitdiff
path: root/MultiSettings.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2021-03-27 10:24:15 +0100
committerChristoph Berg <myon@debian.org>2021-03-27 10:24:15 +0100
commit9655b6f589e8e5fa83d21827884d9488ebff63f4 (patch)
tree9ae726f568c60d008f44f472cdff4983cf75a995 /MultiSettings.cpp
parent624f3a92bc09c65c75dda356f6a9af22feea0b5c (diff)
parent5c88480ddc5c5dab1f3444a8b8de9303fd6140da (diff)
Update upstream source from tag 'upstream/2.4.0_rc4+repack'
Update to upstream version '2.4.0~rc4+repack' with Debian dir 74c7d76ab37efed76838cc21b978156acf14f428
Diffstat (limited to 'MultiSettings.cpp')
-rw-r--r--MultiSettings.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/MultiSettings.cpp b/MultiSettings.cpp
index 29c686d3..55bad6f4 100644
--- a/MultiSettings.cpp
+++ b/MultiSettings.cpp
@@ -576,20 +576,28 @@ void MultiSettings::impl::select_configuration (QString const& target_name)
{
if (main_window_ && target_name != current_)
{
+ bool changed {false};
{
auto const& current_group = settings_.group ();
if (current_group.size ()) settings_.endGroup ();
// position to the alternative settings
SettingsGroup alternatives {&settings_, multi_settings_root_group};
- // save the target settings
- SettingsGroup target_group {&settings_, target_name};
- new_settings_ = get_settings ();
+ if (settings_.childGroups ().contains (target_name))
+ {
+ changed = true;
+ // save the target settings
+ SettingsGroup target_group {&settings_, target_name};
+ new_settings_ = get_settings ();
+ }
if (current_group.size ()) settings_.beginGroup (current_group);
}
- // and set up the restart
- current_ = target_name;
- Q_EMIT parent_->configurationNameChanged (unescape_ampersands (current_));
- restart (RepositionType::save_and_replace);
+ if (changed)
+ {
+ // and set up the restart
+ current_ = target_name;
+ Q_EMIT parent_->configurationNameChanged (unescape_ampersands (current_));
+ restart (RepositionType::save_and_replace);
+ }
}
}