diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-02 19:07:50 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-02 19:07:50 +0100 |
| commit | d96dcf02b131808a25045afc23667ed6a26274a6 (patch) | |
| tree | 01a42a3c59ed664d2ea9e1e830565d3e2260ca8b /src/modlist.cpp | |
| parent | c7abae79b3042cb5a9ab1174a9955d47e6e38fb8 (diff) | |
Refactoring of ModInfo to give access to the core. Remove ModInfo::remove() completely.
Diffstat (limited to 'src/modlist.cpp')
| -rw-r--r-- | src/modlist.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp index 6d53c4f5..a2e59b62 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -1009,16 +1009,7 @@ 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)) { - result = p->remove(); - } - } - else { - result = ModInfo::removeMod(index); - } + bool result = ModInfo::removeMod(ModInfo::getIndex(mod->name())); if (result) { notifyModRemoved(mod->name()); } |
