From 342d529dd6ad36ecc3455927dbe5a1d10cbb648b Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sat, 9 Jan 2021 20:21:43 +0100 Subject: Do not notifyChange if the new name is identical to the old name. --- src/modlist.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 055778f3..f820e4d1 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -555,15 +555,16 @@ bool ModList::renameMod(int index, const QString &newName) m_Profile->cancelModlistWrite(); - if (modInfo->setName(nameFixed)) + if (modInfo->setName(nameFixed)) { // Notice there is a good chance that setName() updated the modinfo indexes // the modRenamed() call will refresh the indexes in the current profile // and update the modlists in all profiles emit modRenamed(oldName, nameFixed); - } + } - // invalidate the currently displayed state of this list - notifyChange(-1); + // invalidate the currently displayed state of this list + notifyChange(-1); + } return true; } -- cgit v1.3.1