|
|
@@ -295,7 +295,7 @@ bool FirstLaunchView::heroesDataDetect()
|
|
|
QString FirstLaunchView::getHeroesInstallDir()
|
|
|
{
|
|
|
#ifdef VCMI_WINDOWS
|
|
|
- QHash<QString, QString> regKeys = {
|
|
|
+ QVector<QPair<QString, QString>> 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<QString, QString>::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{};
|