From ff31ce636b68a19949d6e4049d20f7cf88e29f99 Mon Sep 17 00:00:00 2001 From: Eran Mizrahi Date: Sun, 17 Dec 2017 21:05:18 +0200 Subject: Fix mod rename with custom profiles path --- src/modlist.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/modlist.cpp') 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); } -- cgit v1.3.1