mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Handle case of user selecting "Data" folder of H3 install
After all, we do ask user to select location of Heroes III data...
This commit is contained in:
@@ -264,6 +264,18 @@ void FirstLaunchView::copyHeroesData()
|
||||
if(!sourceRoot.exists())
|
||||
return;
|
||||
|
||||
if (sourceRoot.dirName().compare("data", Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
// We got Data folder. Possibly user selected "Data" folder of Heroes III install. Check whether valid data might exist 1 level above
|
||||
|
||||
QStringList dirData = sourceRoot.entryList({"data"}, QDir::Filter::Dirs);
|
||||
if (dirData.empty())
|
||||
{
|
||||
// This is "Data" folder without any "Data" folders inside. Try to check for data 1 level above
|
||||
sourceRoot.cdUp();
|
||||
}
|
||||
}
|
||||
|
||||
QStringList dirData = sourceRoot.entryList({"data"}, QDir::Filter::Dirs);
|
||||
QStringList dirMaps = sourceRoot.entryList({"maps"}, QDir::Filter::Dirs);
|
||||
QStringList dirMp3 = sourceRoot.entryList({"mp3"}, QDir::Filter::Dirs);
|
||||
|
Reference in New Issue
Block a user