mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
114904a48f
commit
27b921fb1d
2 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue