summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modlist.cpp13
1 files changed, 7 insertions, 6 deletions
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<ModInfo*>(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)