From b148994aa91c3234ff3a770b31a98a7a636763b9 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Sun, 8 Dec 2024 14:51:15 +0100 Subject: [PATCH] fix iterating QHash --- launcher/firstLaunch/firstlaunch_moc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/launcher/firstLaunch/firstlaunch_moc.cpp b/launcher/firstLaunch/firstlaunch_moc.cpp index 05b938e02..d5bc1e0ef 100644 --- a/launcher/firstLaunch/firstlaunch_moc.cpp +++ b/launcher/firstLaunch/firstlaunch_moc.cpp @@ -304,11 +304,13 @@ 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 }; - for(auto & regKey : regKeys) + QHash::const_iterator i = regKeys.constBegin(); + while (i != regKeys.constEnd()) { - QString path = QSettings(regKey, QSettings::NativeFormat).value(regKeys[regKey]).toString(); + QString path = QSettings(i.key(), QSettings::NativeFormat).value(i.value()).toString(); if(!path.isEmpty()) return path; + ++i; } #endif return QString{};