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()
auto newProfile = Profile::Ptr(new Profile(ProfileManager::instance()->fallbackProfile()));
newProfile->clone(sourceProfile, true);
// TODO: add number suffix when the name is taken
newProfile->setProperty(Profile::Name, i18nc("@item This will be used as part of the file name", "New Profile"));
newProfile->setProperty(Profile::UntranslatedName, QStringLiteral("New Profile"));
newProfile->setProperty(Profile::MenuIndex, QStringLiteral("0"));
const QString uniqueName = ProfileManager::instance()->generateUniqueName();
newProfile->setProperty(Profile::Name, uniqueName);
newProfile->setProperty(Profile::UntranslatedName, uniqueName);
// Consider before changing the below
QPointer<EditProfileDialog> dialog = new EditProfileDialog(this);
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