From 65577c71f3e51ae1f029c5fb104782e2a2fdca6d Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sat, 2 Jan 2021 12:43:17 +0100 Subject: Fix notification for removed mods. --- src/modlist.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 41b5c858..b88c6a01 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -958,18 +958,19 @@ MOBase::IModInterface* ModList::getMod(const QString& name) const bool ModList::removeMod(MOBase::IModInterface* mod) { unsigned int index = ModInfo::getIndex(mod->name()); + bool result = false; if (index == UINT_MAX) { if (auto* p = dynamic_cast(mod)) { - return p->remove(); - } - else { - return false; + result = p->remove(); } } else { - return ModInfo::removeMod(index); + result = ModInfo::removeMod(index); + } + if (result) { + notifyModRemoved(mod->name()); } - notifyModRemoved(mod->name()); + return result; } MOBase::IModInterface* ModList::renameMod(MOBase::IModInterface* mod, const QString& name) -- cgit v1.3.1