From fb5530cd691699c96aa035e430459faf00dfb513 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 15 Apr 2015 10:31:24 +0200 Subject: QSettings: use QStandardPath to resolve path on iOS The current solution hard-codes a settings path that on iOS will point to a write protected path inside the sandbox. So change the QSP fallback in QSettings to also include iOS. Note that changing settings path would normally be problematic since it would cause migration issues. However, since the current solution can never have worked on iOS, starting to use QSP now should be fine. Change-Id: Iecad7d84595aee24ca0e2446fa5997296ad8b5a8 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qsettings.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qsettings.cpp') diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index afe68125d4..413f5693f0 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -104,6 +104,10 @@ using namespace ABI::Windows::Storage; #define Q_XDG_PLATFORM #endif +#if !defined(QT_NO_STANDARDPATHS) && (defined(Q_XDG_PLATFORM) || defined(Q_OS_IOS)) +#define QSETTINGS_USE_QSTANDARDPATHS +#endif + // ************************************************************************ // QConfFile @@ -1044,7 +1048,7 @@ static void initDefaultPaths(QMutexLocker *locker) windowsConfigPath(CSIDL_COMMON_APPDATA) + QDir::separator()); #else -#if defined(QT_NO_STANDARDPATHS) || !defined(Q_XDG_PLATFORM) +#ifndef QSETTINGS_USE_QSTANDARDPATHS // Non XDG platforms (OS X, iOS, Blackberry, Android...) have used this code path erroneously // for some time now. Moving away from that would require migrating existing settings. QString userPath; -- cgit v1.2.3