mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Don't allow overwriting on profile rename
This commit is contained in:
parent
10ce65c22b
commit
a03eea9b5f
|
@ -237,16 +237,14 @@ void ProfileForm::onRenameClicked()
|
|||
if (name.isEmpty()) break;
|
||||
name = Core::sanitize(name);
|
||||
|
||||
if (!Profile::profileExists(name) || GUI::askQuestion(tr("Profile already exists", "rename confirm title"),
|
||||
tr("A profile named \"%1\" already exists. Do you want to erase it?", "rename confirm text").arg(name)))
|
||||
{
|
||||
|
||||
|
||||
if (!nexus.getProfile()->rename(name))
|
||||
GUI::showError(tr("Failed to rename", "rename failed title"),
|
||||
tr("Couldn't rename the profile to \"%1\"").arg(cur));
|
||||
if (Profile::profileExists(name))
|
||||
GUI::showError(tr("Profile already exists", "rename failure title"),
|
||||
tr("A profile named \"%1\" already exists.", "rename confirm text").arg(name));
|
||||
else if (!nexus.getProfile()->rename(name))
|
||||
GUI::showError(tr("Failed to rename", "rename failed title"),
|
||||
tr("Couldn't rename the profile to \"%1\"").arg(cur));
|
||||
else
|
||||
break;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user