diff options
| author | Al12rs <gabriel.cortesi@outlook.com> | 2018-04-25 23:48:18 +0200 |
|---|---|---|
| committer | Al12rs <gabriel.cortesi@outlook.com> | 2018-04-25 23:48:18 +0200 |
| commit | cfbe399bbaa6c244359682b71a949bf6cf4d3b4e (patch) | |
| tree | e5ed6a75103859fb969da57fb73fc43fb13de8f3 /src | |
| parent | 10b8d121527fe7b2b79768717c27c563009c20ef (diff) | |
Fixed mod rename to allow just changing letters to uppercase or lowercase.
(Previously it would not allow it as it detected an existing mod having the same name (check is caseInsensitive)).
Diffstat (limited to 'src')
| -rw-r--r-- | src/modlist.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp index 3f9a732a..8c906822 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -436,14 +436,14 @@ bool ModList::renameMod(int index, const QString &newName) return false;
}
- if (ModList::allMods().contains(newName,Qt::CaseInsensitive)) {
+ if (ModList::allMods().contains(nameFixed, Qt::CaseInsensitive) && nameFixed.toLower()!=ModInfo::getByIndex(index)->name().toLower() ) {
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) {
+ if (nameFixed != oldName) {
// before we rename, ensure there is no scheduled asynchronous to rewrite
m_Profile->cancelModlistWrite();
@@ -1211,4 +1211,3 @@ bool ModList::eventFilter(QObject *obj, QEvent *event) }
return QAbstractItemModel::eventFilter(obj, event);
}
-
|
