Commit 9cab1758 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

ProfileSettings: use generateUniqueName() when creating new profiles

This makes new profile name generation consistent everywhere.
parent 238a8b45
...@@ -134,10 +134,9 @@ void ProfileSettings::createProfile() ...@@ -134,10 +134,9 @@ void ProfileSettings::createProfile()
auto newProfile = Profile::Ptr(new Profile(ProfileManager::instance()->fallbackProfile())); auto newProfile = Profile::Ptr(new Profile(ProfileManager::instance()->fallbackProfile()));
newProfile->clone(sourceProfile, true); newProfile->clone(sourceProfile, true);
// TODO: add number suffix when the name is taken const QString uniqueName = ProfileManager::instance()->generateUniqueName();
newProfile->setProperty(Profile::Name, i18nc("@item This will be used as part of the file name", "New Profile")); newProfile->setProperty(Profile::Name, uniqueName);
newProfile->setProperty(Profile::UntranslatedName, QStringLiteral("New Profile")); newProfile->setProperty(Profile::UntranslatedName, uniqueName);
newProfile->setProperty(Profile::MenuIndex, QStringLiteral("0"));
// Consider https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0 before changing the below // Consider https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0 before changing the below
QPointer<EditProfileDialog> dialog = new EditProfileDialog(this); QPointer<EditProfileDialog> dialog = new EditProfileDialog(this);
......
Markdown is supported
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