diff options
author | flow <flowlnlnln@gmail.com> | 2022-06-04 21:18:51 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-07-17 11:33:42 -0300 |
commit | 2d10c246a8e80a5af7535e2ff94442c6db178486 (patch) | |
tree | aa69a770a793e3e458c16eeba5a8eceb70661751 /launcher/minecraft/mod | |
parent | 6e2869834f59ae4863e63a16de97aa3019723b26 (diff) | |
download | PrismLauncher-2d10c246a8e80a5af7535e2ff94442c6db178486.tar.gz PrismLauncher-2d10c246a8e80a5af7535e2ff94442c6db178486.tar.bz2 PrismLauncher-2d10c246a8e80a5af7535e2ff94442c6db178486.zip |
feat: add update mods to the ui / mod model
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/minecraft/mod')
-rw-r--r-- | launcher/minecraft/mod/ModFolderModel.cpp | 12 | ||||
-rw-r--r-- | launcher/minecraft/mod/ModFolderModel.h | 2 |
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); |