From f4d15fd5c24f174c22a3d3f39d9d62de7a7317b1 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Thu, 9 Apr 2020 12:02:38 -0700 Subject: [PATCH] Always generate AppSettings::savePath at runtime for mobile builds --- src/Settings/AppSettings.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Settings/AppSettings.cc b/src/Settings/AppSettings.cc index 67e199dbb..2fa844f5a 100644 --- a/src/Settings/AppSettings.cc +++ b/src/Settings/AppSettings.cc @@ -43,7 +43,13 @@ DECLARE_SETTINGGROUP(App, "") SettingsFact* savePathFact = qobject_cast(savePath()); QString appName = qgcApp()->applicationName(); +#ifdef __mobile__ + // Mobile builds always use the runtime generated location for savePath. The reason is that for example on iOS the save path includes + // a UID for the app in it. When you then update the app that UID could change which in turn makes any saved value invalid. + if (true) { +#else if (savePathFact->rawValue().toString().isEmpty() && _nameToMetaDataMap[savePathName]->rawDefaultValue().toString().isEmpty()) { +#endif #ifdef __mobile__ #ifdef __ios__ QDir rootDir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)); -- 2.22.0