diff options
| author | Al12rs <gabriel.cortesi@outlook.com> | 2018-03-07 13:49:25 +0100 |
|---|---|---|
| committer | Al12rs <gabriel.cortesi@outlook.com> | 2018-03-07 14:41:48 +0100 |
| commit | 673a5034f0eb9fb12befdbb52ea8dd5d72ac302e (patch) | |
| tree | ddd75f9a058e91bf0a0abff7cb34f5dae6be6c40 /src | |
| parent | 7c87e9a64556c588a66482ea9acace52c76af7cd (diff) | |
Added check for mod rename to ensure the new name is not already used by another mod.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modlist.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp index 4002a424..7b2ad1f9 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -424,6 +424,11 @@ bool ModList::renameMod(int index, const QString &newName) return false;
}
+ if (ModList::allMods().contains(newName,Qt::CaseInsensitive)) {
+ MessageDialog::showMessage(tr("Name is already in use by another mod"), nullptr);
+ return false;
+ }
+
ModInfo::Ptr modInfo = ModInfo::getByIndex(index);
QString oldName = modInfo->name();
if (newName != oldName) {
|
