summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@libreoffice.org>2018-05-21 10:55:07 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-05-21 07:57:14 -0700
commit3646fa800bf4bac89593b5a6d43c58350918ddf7 (patch)
tree315094663c5608d31c00ddfecb0540732df4ea32 /mobile-widgets
parent4a872f74a40fa60448140d8f7e45dad2449bc74c (diff)
downloadsubsurface-3646fa800bf4bac89593b5a6d43c58350918ddf7.tar.gz
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 <jani@apache.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp17
1 files changed, 16 insertions, 1 deletions
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);
}