aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/ModFolderModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/minecraft/mod/ModFolderModel.cpp')
-rw-r--r--launcher/minecraft/mod/ModFolderModel.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/launcher/minecraft/mod/ModFolderModel.cpp b/launcher/minecraft/mod/ModFolderModel.cpp
index e72eb13e..adc828c2 100644
--- a/launcher/minecraft/mod/ModFolderModel.cpp
+++ b/launcher/minecraft/mod/ModFolderModel.cpp
@@ -356,6 +356,20 @@ bool ModFolderModel::installMod(const QString &filename)
return false;
}
+bool ModFolderModel::uninstallMod(const QString& filename, bool preserve_metadata)
+{
+
+ for(auto mod : allMods()){
+ if(mod.fileinfo().fileName() == filename){
+ auto index_dir = indexDir();
+ mod.destroy(index_dir, preserve_metadata);
+ return true;
+ }
+ }
+
+ return false;
+}
+
bool ModFolderModel::setModStatus(const QModelIndexList& indexes, ModStatusAction enable)
{
if(interaction_disabled) {