summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qsettings.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-04-15 10:31:24 +0200
committerRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-05-06 19:46:06 +0000
commitfb5530cd691699c96aa035e430459faf00dfb513 (patch)
treea1d9cfacc9e301dc4046fe366d8f2788acfc9f7a /src/corelib/io/qsettings.cpp
parentae050611b4004220071cc49e456bc444d9679ddc (diff)
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 <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib/io/qsettings.cpp')
-rw-r--r--src/corelib/io/qsettings.cpp6
1 files changed, 5 insertions, 1 deletions
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;