summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-08-04 21:54:25 +0200
committerPetr Mrázek <peterix@gmail.com>2016-08-04 21:54:25 +0200
commiteec87db86a8a00db0a9145a3b17c53408f7b1f5b (patch)
tree9df591cc6fe52f3a84c15cdecbbf20959ab99f30 /api
parent42a98c366129bba97464f7ac3771b547d6cae804 (diff)
downloadMultiMC-eec87db86a8a00db0a9145a3b17c53408f7b1f5b.tar
MultiMC-eec87db86a8a00db0a9145a3b17c53408f7b1f5b.tar.gz
MultiMC-eec87db86a8a00db0a9145a3b17c53408f7b1f5b.tar.lz
MultiMC-eec87db86a8a00db0a9145a3b17c53408f7b1f5b.tar.xz
MultiMC-eec87db86a8a00db0a9145a3b17c53408f7b1f5b.zip
GH-1635 add filter bar to mod list pages
Diffstat (limited to 'api')
-rw-r--r--api/logic/minecraft/ModList.cpp11
-rw-r--r--api/logic/minecraft/ModList.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/api/logic/minecraft/ModList.cpp b/api/logic/minecraft/ModList.cpp
index 36371ee3..ad588f16 100644
--- a/api/logic/minecraft/ModList.cpp
+++ b/api/logic/minecraft/ModList.cpp
@@ -199,6 +199,17 @@ bool ModList::deleteMods(int first, int last)
return true;
}
+bool ModList::deleteMods(const QVector<int> &indexes)
+{
+ for (auto i: indexes)
+ {
+ Mod &m = mods[i];
+ m.destroy();
+ }
+ emit changed();
+ return true;
+}
+
int ModList::columnCount(const QModelIndex &parent) const
{
return 3;
diff --git a/api/logic/minecraft/ModList.h b/api/logic/minecraft/ModList.h
index 1a42c8f8..24dcdaa4 100644
--- a/api/logic/minecraft/ModList.h
+++ b/api/logic/minecraft/ModList.h
@@ -89,6 +89,9 @@ public:
/// Deletes all the selected mods
virtual bool deleteMods(int first, int last);
+ /// Deletes all the selected mods
+ virtual bool deleteMods(const QVector<int> &indexes);
+
void startWatching();
void stopWatching();