summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/ModList.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-08-04 23:16:03 +0200
committerPetr Mrázek <peterix@gmail.com>2016-08-04 23:16:03 +0200
commitb76d4573cdaa41a3493596571dbba452ab7a5b2e (patch)
treebb2412b3b2d7307ac2f1084771f923020e511fc6 /api/logic/minecraft/ModList.cpp
parent6ec2652b4562119ccf45d3bc455ef865fdfbd3ce (diff)
downloadMultiMC-b76d4573cdaa41a3493596571dbba452ab7a5b2e.tar
MultiMC-b76d4573cdaa41a3493596571dbba452ab7a5b2e.tar.gz
MultiMC-b76d4573cdaa41a3493596571dbba452ab7a5b2e.tar.lz
MultiMC-b76d4573cdaa41a3493596571dbba452ab7a5b2e.tar.xz
MultiMC-b76d4573cdaa41a3493596571dbba452ab7a5b2e.zip
GH-589 GH-842 GH-901 GH-1117 allow mass-enabling/disabling of mods
Diffstat (limited to 'api/logic/minecraft/ModList.cpp')
-rw-r--r--api/logic/minecraft/ModList.cpp15
1 files changed, 15 insertions, 0 deletions
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())