diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp index 2b1678a93..7ecf78b30 100644 --- a/src/SessionManager.cpp +++ b/src/SessionManager.cpp @@ -259,7 +259,7 @@ void SessionManager::sortProfiles(QList& list) void SessionManager::saveSettings() { // save default profile - setDefaultProfile(_defaultProfile); + saveDefaultProfile(); // save shortcuts saveShortcuts(); @@ -570,16 +570,20 @@ bool SessionManager::deleteProfile(Profile::Ptr type) return true; } + void SessionManager::setDefaultProfile(Profile::Ptr profile) { Q_ASSERT(_profiles.contains(profile)); _defaultProfile = profile; +} - QString path = profile->path(); +void SessionManager::saveDefaultProfile() +{ + QString path = _defaultProfile->path(); if (path.isEmpty()) - path = KDE4ProfileWriter().getPath(profile); + path = KDE4ProfileWriter().getPath(_defaultProfile); QFileInfo fileInfo(path); @@ -588,6 +592,7 @@ void SessionManager::setDefaultProfile(Profile::Ptr profile) KConfigGroup group = config->group("Desktop Entry"); group.writeEntry("DefaultProfile", fileInfo.fileName()); } + QSet SessionManager::findFavorites() { loadFavorites(); diff --git a/src/SessionManager.h b/src/SessionManager.h index c28834281..f8e8124d7 100644 --- a/src/SessionManager.h +++ b/src/SessionManager.h @@ -315,6 +315,12 @@ private: void loadFavorites(); //saves the set of favorite sessions void saveFavorites(); + + // records which profile is set as the default profile + // Note: it does not save the profile itself into disk. That is + // what saveProfile() does. + void saveDefaultProfile(); + // saves a profile to a file // returns the path to which the profile was saved, which will // be the same as the path property of profile if valid or a newly generated path