mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[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.
This commit is contained in:
parent
e4c67f5ea5
commit
178d392361
1 changed files with 6 additions and 2 deletions
|
|
@ -115,9 +115,13 @@ SettingsCache::SettingsCache()
|
||||||
|
|
||||||
// Decide once, before any migration writes new files, whether this is an
|
// Decide once, before any migration writes new files, whether this is an
|
||||||
// existing install. Fresh installs have no *.ini files and no legacy
|
// 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 =
|
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);
|
settings = new QSettings(settingsPath + "global.ini", QSettings::IniFormat, this);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue