diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-02 12:43:17 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-02 15:40:10 +0100 |
| commit | 65577c71f3e51ae1f029c5fb104782e2a2fdca6d (patch) | |
| tree | b7ade0b736cf21bdc57ca09a60120cc85d013c49 /src/modlist.cpp | |
| parent | e6769bacdd3ea7d907a853a24fd3de1e8e924400 (diff) | |
Fix notification for removed mods.
Diffstat (limited to 'src/modlist.cpp')
| -rw-r--r-- | src/modlist.cpp | 13 |
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) |
