From 178d392361024ce065f3dca3e6ca6f6adfed98bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Tue, 13 Oct 2026 07:16:47 +0200 Subject: [PATCH] [Tutorial] Ignore macOS global prefs when detecting existing installs QSettings with fallbacks enabled reads the global preferences domain on macOS, so allKeys() returns system keys (AppleLanguages etc.) even on a fresh install and the tutorial never shows for new Mac users. --- cockatrice/src/client/settings/cache_settings.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/client/settings/cache_settings.cpp b/cockatrice/src/client/settings/cache_settings.cpp index 482b8f67b..49af0b5f5 100644 --- a/cockatrice/src/client/settings/cache_settings.cpp +++ b/cockatrice/src/client/settings/cache_settings.cpp @@ -115,9 +115,13 @@ SettingsCache::SettingsCache() // Decide once, before any migration writes new files, whether this is an // existing install. Fresh installs have no *.ini files and no legacy - // NativeFormat keys; upgrades have one or the other. + // NativeFormat keys; upgrades have one or the other. Fallbacks are disabled + // so that on macOS the global preferences domain (AppleLanguages etc.) is + // not mistaken for existing Cockatrice settings on a fresh install. + QSettings legacy; + legacy.setFallbacksEnabled(false); const bool hadExistingSettings = - !QDir(settingsPath).entryList({"*.ini"}, QDir::Files).isEmpty() || !QSettings().allKeys().isEmpty(); + !QDir(settingsPath).entryList({"*.ini"}, QDir::Files).isEmpty() || !legacy.allKeys().isEmpty(); settings = new QSettings(settingsPath + "global.ini", QSettings::IniFormat, this);