summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-04-13 16:43:20 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-04-13 17:07:43 -0700
commit27b921fb1d0c9d5350a9834837465178aa8e819d (patch)
treeed7d305f56daeb5a464837ae662b56d688471127
parent114904a48f7ec6f10e355da24be2bfa1e5821a0e (diff)
downloadsubsurface-27b921fb1d0c9d5350a9834837465178aa8e819d.tar.gz
iOS: make logfile accessible to user
By creating it in the Documents path and setting the two magic keys, iOS will make the log file available to the user. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--mobile-widgets/qmlmanager.cpp5
-rw-r--r--packaging/ios/Info.plist.in4
2 files changed, 9 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 7ddf05e24..9aaca2f24 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -146,7 +146,12 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
QString libdcLogFileName = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).first() + "/libdivecomputer.log";
logfile_name = copy_qstring(libdcLogFileName);
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
+#if defined(Q_OS_ANDROID)
appLogFileName = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).first() + "/subsurface.log";
+#elif defined(Q_OS_IOS)
+ // on iOS we should save the data to the DocumentsLocation so it becomes accessible to the user
+ appLogFileName = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).first() + "/subsurface.log";
+#endif
appLogFile.setFileName(appLogFileName);
if (!appLogFile.open(QIODevice::ReadWrite|QIODevice::Truncate)) {
appLogFileOpen = false;
diff --git a/packaging/ios/Info.plist.in b/packaging/ios/Info.plist.in
index c64d04560..dab667ccd 100644
--- a/packaging/ios/Info.plist.in
+++ b/packaging/ios/Info.plist.in
@@ -54,5 +54,9 @@
<string>Subsurface-mobile can track your location to match imported dives</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Subsurface-mobile can track your location to match imported dives</string>
+ <key>UIFileSharingEnabled</key>
+ <string>YES</string>
+ <key>LSSupportsOpeningDocumentsInPlace</key>
+ <string>YES</string>
</dict>
</plist>