1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Merge pull request #6267 from GeorgeK1ng/map_name_import_fix

Fix import maps filenames on Android
This commit is contained in:
Ivan Savenko
2025-11-01 21:28:46 +02:00
committed by GitHub

View File

@@ -1110,8 +1110,10 @@ void CModListView::installMaps(QStringList maps)
}
else
{
QString fileName = map.section('/', -1, -1);
if (QFile::exists(destDir + fileName))
QString srcPath = Helper::getRealPath(map);
QString fileName = QFileInfo(srcPath).fileName();
QString destFile = destDir + fileName;
if (QFile::exists(destFile))
conflictCount++;
}
}
@@ -1198,9 +1200,11 @@ void CModListView::installMaps(QStringList maps)
else
{
// Single map file
QString fileName = map.section('/', -1, -1);
QString srcPath = Helper::getRealPath(map);
QString fileName = QFileInfo(srcPath).fileName();
QString destFile = destDir + fileName;
logGlobal->info("Importing map '%s'", map.toStdString());
logGlobal->info("Importing map '%s'", srcPath.toStdString());
if (QFile::exists(destFile))
{