feat: remove existing mod when updating/redownloading it
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user