feat: remove existing mod when updating/redownloading it

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-06-10 16:43:01 -03:00
parent 1709b47bb7
commit dfab55112b
7 changed files with 44 additions and 3 deletions

View File

@ -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) {