diff --git a/launcher/firstLaunch/firstlaunch_moc.cpp b/launcher/firstLaunch/firstlaunch_moc.cpp index d5bc1e0ef..779784ee5 100644 --- a/launcher/firstLaunch/firstlaunch_moc.cpp +++ b/launcher/firstLaunch/firstlaunch_moc.cpp @@ -295,7 +295,7 @@ bool FirstLaunchView::heroesDataDetect() QString FirstLaunchView::getHeroesInstallDir() { #ifdef VCMI_WINDOWS - QHash regKeys = { + QVector> regKeys = { { "HKEY_LOCAL_MACHINE\\SOFTWARE\\GOG.com\\Games\\1207658787", "path" }, // Gog on x86 system { "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\GOG.com\\Games\\1207658787", "path" }, // Gog on x64 system { "HKEY_LOCAL_MACHINE\\SOFTWARE\\New World Computing\\Heroes of Might and MagicĀ® III\\1.0", "AppPath" }, // H3 Complete on x86 system @@ -304,13 +304,11 @@ QString FirstLaunchView::getHeroesInstallDir() { "HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\New World Computing\\Heroes of Might and Magic III\\1.0", "AppPath" }, // some localized H3 on x64 system }; - QHash::const_iterator i = regKeys.constBegin(); - while (i != regKeys.constEnd()) + for(auto & regKey : regKeys) { - QString path = QSettings(i.key(), QSettings::NativeFormat).value(i.value()).toString(); + QString path = QSettings(regKey.first, QSettings::NativeFormat).value(regKey.second).toString(); if(!path.isEmpty()) return path; - ++i; } #endif return QString{};