From 4a64904a89ad5113038deedc01125c47258179e1 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 7 Oct 2021 22:52:12 +0200 Subject: [PATCH] Save the config when setDefaultProfile() is called It doesn't seem useful to delay saving to when the the MainWindow destructor calls ProfileManager::saveSettings(). This seems to be fallout from a previous refactor to put all the global settings dialogs in one parent dialog (ConfigurationDialog), because now nothing actually calls ProfileSettings::slotAccepted(). --- src/profile/ProfileManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/profile/ProfileManager.cpp b/src/profile/ProfileManager.cpp index dd9ea38a..83ffd61f 100644 --- a/src/profile/ProfileManager.cpp +++ b/src/profile/ProfileManager.cpp @@ -215,9 +215,6 @@ void ProfileManager::loadAllProfiles(const QString &defaultProfileFileName) void ProfileManager::saveSettings() { - // save default profile - saveDefaultProfile(); - // save shortcuts saveShortcuts(); @@ -420,6 +417,8 @@ void ProfileManager::setDefaultProfile(const Profile::Ptr &profile) _defaultProfile = profile; ProfileModel::instance()->setDefault(profile); + saveDefaultProfile(); + // Setting/unsetting a profile as the default is a sort of a // "profile change", useful for updating the icon/font of the // "default profile in e.g. 'File -> New Tab' menu. @@ -439,6 +438,7 @@ void ProfileManager::saveDefaultProfile() KSharedConfigPtr appConfig = KSharedConfig::openConfig(); KConfigGroup group = appConfig->group("Desktop Entry"); group.writeEntry("DefaultProfile", QUrl::fromLocalFile(path).fileName()); + appConfig->sync(); } void ProfileManager::loadShortcuts()