From d96dcf02b131808a25045afc23667ed6a26274a6 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sat, 2 Jan 2021 19:07:50 +0100 Subject: Refactoring of ModInfo to give access to the core. Remove ModInfo::remove() completely. --- src/modlist.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/modlist.cpp') 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(mod)) { - result = p->remove(); - } - } - else { - result = ModInfo::removeMod(index); - } + bool result = ModInfo::removeMod(ModInfo::getIndex(mod->name())); if (result) { notifyModRemoved(mod->name()); } -- cgit v1.3.1