1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +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 else
{ {
QString fileName = map.section('/', -1, -1); QString srcPath = Helper::getRealPath(map);
if (QFile::exists(destDir + fileName)) QString fileName = QFileInfo(srcPath).fileName();
QString destFile = destDir + fileName;
if (QFile::exists(destFile))
conflictCount++; conflictCount++;
} }
} }
@@ -1198,9 +1200,11 @@ void CModListView::installMaps(QStringList maps)
else else
{ {
// Single map file // Single map file
QString fileName = map.section('/', -1, -1); QString srcPath = Helper::getRealPath(map);
QString fileName = QFileInfo(srcPath).fileName();
QString destFile = destDir + fileName; QString destFile = destDir + fileName;
logGlobal->info("Importing map '%s'", map.toStdString());
logGlobal->info("Importing map '%s'", srcPath.toStdString());
if (QFile::exists(destFile)) if (QFile::exists(destFile))
{ {