From 726f22043f47c19db994d6d2a28a07aa8a16b225 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Sun, 8 Dec 2024 13:39:45 +0100 Subject: [PATCH] use qhash --- launcher/firstLaunch/firstlaunch_moc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launcher/firstLaunch/firstlaunch_moc.cpp b/launcher/firstLaunch/firstlaunch_moc.cpp index 0fc2dde83..05b938e02 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 - std::map regKeys = { + QHash 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 @@ -306,7 +306,7 @@ QString FirstLaunchView::getHeroesInstallDir() for(auto & regKey : regKeys) { - QString path = QSettings(regKey.first, QSettings::NativeFormat).value(regKey.second).toString(); + QString path = QSettings(regKey, QSettings::NativeFormat).value(regKeys[regKey]).toString(); if(!path.isEmpty()) return path; }