mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
4a872f74a4
commit
3646fa800b
1 changed files with 16 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue