From 673a5034f0eb9fb12befdbb52ea8dd5d72ac302e Mon Sep 17 00:00:00 2001 From: Al12rs Date: Wed, 7 Mar 2018 13:49:25 +0100 Subject: Added check for mod rename to ensure the new name is not already used by another mod. --- src/modlist.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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) { -- cgit v1.3.1