aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/ModFolderModel.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-16 19:53:39 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-16 19:53:39 +0300
commit589d8b6923531a53cbccabb8b79ed9861d0fe27c (patch)
tree18623d7c5dbf637f70018f7edceb1884a746d868 /launcher/minecraft/mod/ModFolderModel.cpp
parent8f5bb982cd27dd9158b63d826769c168455a139b (diff)
downloadPrismLauncher-589d8b6923531a53cbccabb8b79ed9861d0fe27c.tar.gz
PrismLauncher-589d8b6923531a53cbccabb8b79ed9861d0fe27c.tar.bz2
PrismLauncher-589d8b6923531a53cbccabb8b79ed9861d0fe27c.zip
feat:Added remove metadata button
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/minecraft/mod/ModFolderModel.cpp')
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/launcher/minecraft/mod/ModFolderModel.cpp b/launcher/minecraft/mod/ModFolderModel.cpp
index 280e70d7..d6ce98ed 100644
--- a/launcher/minecraft/mod/ModFolderModel.cpp
+++ b/launcher/minecraft/mod/ModFolderModel.cpp
@@ -228,6 +228,25 @@ bool ModFolderModel::deleteMods(const QModelIndexList& indexes)
return true;
}
+bool ModFolderModel::deleteModsMeatadata(const QModelIndexList& indexes)
+{
+ if (indexes.isEmpty())
+ return true;
+
+ for (auto i : indexes) {
+ if (i.column() != 0) {
+ continue;
+ }
+ auto m = at(i.row());
+ auto index_dir = indexDir();
+ m->destroyMetadata(index_dir);
+ }
+
+ update();
+
+ return true;
+}
+
bool ModFolderModel::isValid()
{
return m_dir.exists() && m_dir.isReadable();