From 74d1afc0d5cd2baa6a787864d41d742f7864029d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 21 Jun 2018 17:09:45 +0900 Subject: mobile: iOS/Android: always delete libdivecomputer.log at start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way the user doesn't inadvertantly end up with information from a previous run of Subsurface-mobile when they copy the logs to the clipboard. Not sure we should do the same when building for desktop, so right now it's only when building for a device. Reported-by: Thomas Fänge Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlmanager.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mobile-widgets/qmlmanager.cpp') diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 8e7664229..8d4ae6314 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -155,6 +156,9 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), appLogFileName = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).first() + "/subsurface.log"; QString libdcLogFileName = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).first() + "/libdivecomputer.log"; #endif + // remove the existing libdivecomputer logfile so we don't copy an old one by mistake + QFile libdcLog(libdcLogFileName); + libdcLog.remove(); logfile_name = copy_qstring(libdcLogFileName); appLogFile.setFileName(appLogFileName); if (!appLogFile.open(QIODevice::ReadWrite|QIODevice::Truncate)) { -- cgit v1.2.3-70-g09d2