match disabled mods on uninstall

fixes #4537
This ensures that when looking to uninstall a resource prism will
consider the disabled ones to.
Right now we have a guard in place to prevent resources using the same
name so this check will allways match with the correct resouce.

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2025-12-20 23:54:31 +02:00
parent d3f59a8a43
commit 08c45684de

View File

@@ -207,7 +207,13 @@ void ResourceFolderModel::installResourceWithFlameMetadata(QString path, ModPlat
bool ResourceFolderModel::uninstallResource(const QString& file_name, bool preserve_metadata)
{
for (auto& resource : m_resources) {
if (resource->fileinfo().fileName() == file_name) {
auto resourceFileInfo = resource->fileinfo();
auto resourceFileName = resource->fileinfo().fileName();
if (!resource->enabled() && resourceFileName.endsWith(".disabled")) {
resourceFileName.chop(9);
}
if (resourceFileName == file_name) {
auto res = resource->destroy(indexDir(), preserve_metadata, false);
update();