From b76d4573cdaa41a3493596571dbba452ab7a5b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 4 Aug 2016 23:16:03 +0200 Subject: GH-589 GH-842 GH-901 GH-1117 allow mass-enabling/disabling of mods --- api/logic/minecraft/ModList.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'api/logic/minecraft/ModList.cpp') diff --git a/api/logic/minecraft/ModList.cpp b/api/logic/minecraft/ModList.cpp index b9c7d9ba..d1ad75ab 100644 --- a/api/logic/minecraft/ModList.cpp +++ b/api/logic/minecraft/ModList.cpp @@ -175,6 +175,21 @@ bool ModList::installMod(const QString &filename) return false; } +bool ModList::enableMods(const QModelIndexList& indexes, bool enable) +{ + if(indexes.isEmpty()) + return true; + + for (auto i: indexes) + { + Mod &m = mods[i.row()]; + m.enable(enable); + emit dataChanged(i, i); + } + emit changed(); + return true; +} + bool ModList::deleteMods(const QModelIndexList& indexes) { if(indexes.isEmpty()) -- cgit v1.2.3