Commit d1948549 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Change ProfileManager::changeProfile to take PropertyMap by const &

parent be1174c9
......@@ -267,7 +267,7 @@ QString ProfileManager::saveProfile(const Profile::Ptr &profile)
return newPath;
}
void ProfileManager::changeProfile(Profile::Ptr profile, Profile::PropertyMap propertyMap, bool persistent)
void ProfileManager::changeProfile(Profile::Ptr profile, const Profile::PropertyMap &propertyMap, bool persistent)
{
Q_ASSERT(profile);
......@@ -284,7 +284,7 @@ void ProfileManager::changeProfile(Profile::Ptr profile, Profile::PropertyMap pr
profile->assignProperties(propertyMap);
// Check if the name changed
for (auto it = propertyMap.cbegin(); it != propertyMap.cend(); ++it) {
for (auto it = propertyMap.cbegin(), endIt = propertyMap.cend(); it != endIt; ++it) {
const auto property = it.key();
isNameChanged |= property == Profile::Name || property == Profile::UntranslatedName;
if (isNameChanged) {
......
......@@ -132,7 +132,7 @@ public:
* set this to false if you want to preview possible changes to a profile but do not
* wish to make them permanent.
*/
void changeProfile(Profile::Ptr profile, Profile::PropertyMap propertyMap, bool persistent = true);
void changeProfile(Profile::Ptr profile, const Profile::PropertyMap &propertyMap, bool persistent = true);
/**
* Sets the @p profile as the default profile for creating new sessions
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment