diff --git a/src/ManageProfilesDialog.cpp b/src/ManageProfilesDialog.cpp index c972fd23c..27832bd11 100644 --- a/src/ManageProfilesDialog.cpp +++ b/src/ManageProfilesDialog.cpp @@ -199,7 +199,7 @@ void ManageProfilesDialog::populateTable() _sessionModel->setHorizontalHeaderLabels( QStringList() << i18n("Name") << i18n("Show in Menu") << i18n("Shortcut") ); - foreach(const Profile::Ptr info,SessionManager::instance()->loadedProfiles()) + foreach(const Profile::Ptr &info,SessionManager::instance()->loadedProfiles()) { addItems(info); } @@ -256,7 +256,7 @@ void ManageProfilesDialog::tableSelectionChanged(const QItemSelection&) } void ManageProfilesDialog::deleteSelected() { - foreach(Profile::Ptr profile, selectedProfiles()) + foreach(const Profile::Ptr &profile, selectedProfiles()) { if (profile != SessionManager::instance()->defaultProfile()) SessionManager::instance()->deleteProfile(profile); @@ -306,7 +306,7 @@ void ManageProfilesDialog::editSelected() EditProfileDialog dialog(this); // the dialog will delete the profile group when it is destroyed ProfileGroup* group = new ProfileGroup; - foreach(Profile::Ptr profile,selectedProfiles()) + foreach(const Profile::Ptr &profile,selectedProfiles()) group->addProfile(profile); group->updateValues(); diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp index 6ea354d6f..0edf0edd8 100644 --- a/src/SessionManager.cpp +++ b/src/SessionManager.cpp @@ -345,7 +345,7 @@ void SessionManager::changeProfile(Profile::Ptr info , ProfileGroup::Ptr group = info->asGroup(); if (group) { - foreach(Profile::Ptr profile, group->profiles()) + foreach(const Profile::Ptr &profile, group->profiles()) changeProfile(profile,propertyMap,persistant); return; }