diff --git a/ChangeLog.md b/ChangeLog.md
index 004837b7952f16cd2fc8d42aa8cc08dbd6766429..2b4787fc56a75a49e8d75df0ccdacbc5332156e2 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -13,7 +13,11 @@ Note: This file only contains high level features or important fixes.
## 4.0
-## 4.0.7 - Not yet released
+## 4.0.8 - Not yet released
+
+* iOS: Modify QGC file storage location to support new Files app
+
+## 4.0.7 - Stable
* Fix video page sizing
* Virtual Joystick: Fix right stick centering. Fix/add support for rover/sub reverse throttle support.
diff --git a/ios/iOS-Info.plist b/ios/iOS-Info.plist
index 042cab652291a6aa701cf981958d21263f05e69f..6b7513cea1248357e2aa42ed56e88dbc7b393755 100644
--- a/ios/iOS-Info.plist
+++ b/ios/iOS-Info.plist
@@ -86,5 +86,6 @@
UIFileSharingEnabled
-
+ LSSupportsOpeningDocumentsInPlace
+
diff --git a/src/Settings/AppSettings.cc b/src/Settings/AppSettings.cc
index 5d090049c48f1ed4a0568f3ece4628ae7d16ed59..7a6ffbd73449d71cb732721f506823e47db832a4 100644
--- a/src/Settings/AppSettings.cc
+++ b/src/Settings/AppSettings.cc
@@ -53,23 +53,27 @@ 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) {
+ // Mobile builds always use the runtime generated location for savePath.
+ bool userHasModifiedSavePath = false;
#else
- if (savePathFact->rawValue().toString().isEmpty() && _nameToMetaDataMap[savePathName]->rawDefaultValue().toString().isEmpty()) {
+ bool userHasModifiedSavePath = !savePathFact->rawValue().toString().isEmpty() || !_nameToMetaDataMap[savePathName]->rawDefaultValue().toString().isEmpty();
#endif
+
+ if (!userHasModifiedSavePath) {
#ifdef __mobile__
-#ifdef __ios__
- QDir rootDir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
-#else
+ #ifdef __ios__
+ // This will expose the directories directly to the File iOs app
+ QDir rootDir = QDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
+ savePathFact->setRawValue(rootDir.absolutePath());
+ #else
QDir rootDir = QDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
-#endif
+ savePathFact->setRawValue(rootDir.filePath(appName));
+ #endif
savePathFact->setVisible(false);
#else
QDir rootDir = QDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
-#endif
savePathFact->setRawValue(rootDir.filePath(appName));
+#endif
}
connect(savePathFact, &Fact::rawValueChanged, this, &AppSettings::savePathsChanged);
diff --git a/src/api/QGCCorePlugin.cc b/src/api/QGCCorePlugin.cc
index 43857410a3c885b69f1cced9ce392c800f707f9d..7ae9ea4dc7bc1de96540ac5628df4d80b55bf0a5 100644
--- a/src/api/QGCCorePlugin.cc
+++ b/src/api/QGCCorePlugin.cc
@@ -339,8 +339,7 @@ bool QGCCorePlugin::overrideSettingsGroupVisibility(QString name)
bool QGCCorePlugin::adjustSettingMetaData(const QString& settingsGroup, FactMetaData& metaData)
{
- if (settingsGroup != AppSettings::settingsGroup) {
- // All changes refer to AppSettings
+ if (settingsGroup == AppSettings::settingsGroup) {
#if !defined(QGC_ENABLE_PAIRING)
//-- If we don't support pairing, disable it.
if (metaData.name() == AppSettings::usePairingName) {
@@ -349,36 +348,28 @@ bool QGCCorePlugin::adjustSettingMetaData(const QString& settingsGroup, FactMeta
return false;
}
#endif
- return true;
- }
- //-- Default Palette
- if (metaData.name() == AppSettings::indoorPaletteName) {
- QVariant outdoorPalette;
+ //-- Default Palette
+ if (metaData.name() == AppSettings::indoorPaletteName) {
+ QVariant outdoorPalette;
#if defined (__mobile__)
- outdoorPalette = 0;
+ outdoorPalette = 0;
#else
- outdoorPalette = 1;
+ outdoorPalette = 1;
#endif
- metaData.setRawDefaultValue(outdoorPalette);
- return true;
- //-- Auto Save Telemetry Logs
- } else if (metaData.name() == AppSettings::telemetrySaveName) {
+ metaData.setRawDefaultValue(outdoorPalette);
+ return true;
+ }
+
#if defined (__mobile__)
- metaData.setRawDefaultValue(false);
- return true;
-#else
- metaData.setRawDefaultValue(true);
- return true;
-#endif
-#if defined(__ios__)
- } else if (metaData.name() == AppSettings::savePathName) {
- QString appName = qgcApp()->applicationName();
- QDir rootDir = QDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
- metaData.setRawDefaultValue(rootDir.filePath(appName));
- return false;
+ if (metaData.name() == AppSettings::telemetrySaveName) {
+ // Mobile devices have limited storage so don't turn on telemtry saving by default
+ metaData.setRawDefaultValue(false);
+ return true;
+ }
#endif
}
+
return true; // Show setting in ui
}