aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft')
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp12
-rw-r--r--launcher/minecraft/mod/ModFolderModel.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/launcher/minecraft/mod/ModFolderModel.cpp b/launcher/minecraft/mod/ModFolderModel.cpp
index 5ee08cbf..e72eb13e 100644
--- a/launcher/minecraft/mod/ModFolderModel.cpp
+++ b/launcher/minecraft/mod/ModFolderModel.cpp
@@ -259,6 +259,18 @@ bool ModFolderModel::isValid()
return m_dir.exists() && m_dir.isReadable();
}
+auto ModFolderModel::selectedMods(QModelIndexList& indexes) -> std::list<Mod>
+{
+ std::list<Mod> selected_mods;
+ for (auto i : indexes) {
+ if(i.column() != 0)
+ continue;
+
+ selected_mods.push_back(mods[i.row()]);
+ }
+ return selected_mods;
+}
+
// FIXME: this does not take disabled mod (with extra .disable extension) into account...
bool ModFolderModel::installMod(const QString &filename)
{
diff --git a/launcher/minecraft/mod/ModFolderModel.h b/launcher/minecraft/mod/ModFolderModel.h
index 24b4d358..c3b493b8 100644
--- a/launcher/minecraft/mod/ModFolderModel.h
+++ b/launcher/minecraft/mod/ModFolderModel.h
@@ -144,6 +144,8 @@ public:
return mods;
}
+ auto selectedMods(QModelIndexList& indexes) -> std::list<Mod>;
+
public slots:
void disableInteraction(bool disabled);