From 27b921fb1d0c9d5350a9834837465178aa8e819d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 13 Apr 2018 16:43:20 -0700 Subject: 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 --- mobile-widgets/qmlmanager.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mobile-widgets/qmlmanager.cpp') 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; -- cgit v1.2.3-70-g09d2