1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-26 08:41:13 +02:00

Merge pull request #998 from Nordsoft91/fix-994

[994] fixed
This commit is contained in:
Andrii Danylchenko 2022-09-25 17:45:27 +03:00 committed by GitHub
commit e11a5dbffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,14 +313,17 @@ bool CModManager::removeModDir(QString path)
{
// issues 2673 and 2680 its why you do not recursively remove without sanity check
QDir checkDir(path);
QDir dir(path);
if(!checkDir.cdUp() || QString::compare("Mods", checkDir.dirName(), Qt::CaseInsensitive))
return false;
#ifndef VCMI_IOS //ios applications are stored in the isolated container
if(!checkDir.cdUp() || QString::compare("vcmi", checkDir.dirName(), Qt::CaseInsensitive))
return false;
QDir dir(path);
if(!dir.absolutePath().contains("vcmi", Qt::CaseInsensitive))
return false;
#endif
if(!dir.absolutePath().contains("Mods", Qt::CaseInsensitive))
return false;