From 3646fa800bf4bac89593b5a6d43c58350918ddf7 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Mon, 21 May 2018 10:55:07 +0200 Subject: iOS: copy libdivecomputer.log to clipboard Read libdivecomputer.log file and append to clipboard Remark, subsurface_open is not available in iOS so using QFile instead. Signed-off-by: Jan Iversen --- mobile-widgets/qmlmanager.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index c92aa869f..5000d494d 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -340,7 +340,22 @@ void QMLManager::copyAppLogToClipboard() * The user clicked the button, so copy the log file * to the clipboard for easy access */ - QString copyString = MessageHandlerModel::self()->logAsString(); + + // Add heading and append subsurface.log + QString copyString = "---------- subsurface.log ----------\n"; + copyString += MessageHandlerModel::self()->logAsString(); + + // Add heading and append libdivecomputer.log + QFile f(logfile_name); + if (f.open(QFile::ReadOnly | QFile::Text)) { + copyString += "\n\n\n---------- libdivecomputer.log ----------\n"; + + QTextStream in(&f); + copyString += in.readAll(); + } + copyString += "---------- finish ----------\n"; + + // and copy to clipboard QApplication::clipboard()->setText(copyString, QClipboard::Clipboard); } -- cgit v1.2.3-70-g09d2