feat:Added remove metadata button

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-08-16 19:53:39 +03:00
parent 8f5bb982cd
commit 589d8b6923
8 changed files with 79 additions and 7 deletions

View File

@ -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();