diff options
| author | Eran Mizrahi <erasmux@gmail.com> | 2017-12-17 21:05:18 +0200 |
|---|---|---|
| committer | Eran Mizrahi <erasmux@gmail.com> | 2017-12-18 20:04:44 +0200 |
| commit | ff31ce636b68a19949d6e4049d20f7cf88e29f99 (patch) | |
| tree | 1ef28878f4a56e2d86c0072c668db00a2434b389 /src/modlist.cpp | |
| parent | 90421277e7ed0044b499d81f06df95bf62111ce9 (diff) | |
Fix mod rename with custom profiles path
Diffstat (limited to 'src/modlist.cpp')
| -rw-r--r-- | src/modlist.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp index c028432c..046e2280 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -424,13 +424,13 @@ bool ModList::renameMod(int index, const QString &newName) return false;
}
- // before we rename, write back the current profile so we don't lose changes and to ensure
- // there is no scheduled asynchronous rewrite anytime soon
- m_Profile->writeModlistNow();
-
ModInfo::Ptr modInfo = ModInfo::getByIndex(index);
QString oldName = modInfo->name();
- if (modInfo->setName(nameFixed)) {
+ if (newName != oldName && modInfo->setName(nameFixed)) {
+ // before we rename, write back the current profile so we don't lose changes and to ensure
+ // there is no scheduled asynchronous rewrite anytime soon
+ m_Profile->writeModlistNow();
+
// this just disabled the mod in all profiles. The recipient of modRenamed must fix that
emit modRenamed(oldName, nameFixed);
}
|
