From 9e962ed51accfcb51c471f390979414bbc1fdfea Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Mon, 8 Jan 2024 19:26:19 +0100 Subject: [PATCH] add: attempt to write settings dump to the clipboard before quitting --- src/main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3523ffcd56..b48979cfb4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -300,8 +300,17 @@ bool mainStartupMisc(const QStringList &arguments) { NoteFolder::migrateToNoteFolders(); if (parser.isSet(dumpSettingsOption)) { - fprintf(stdout, "%s\n", Utils::Misc::generateDebugInformation().toLocal8Bit().constData()); - exit(0); + const auto dump = Utils::Misc::generateDebugInformation(); + + // Copy dump to the clipboard (doesn't seem to work yet when the app is quit) + QClipboard *clipboard = QApplication::clipboard(); + clipboard->setText(dump); + QCoreApplication::processEvents(); + + // Print the dump to stdout and copy it to the clipboard + fprintf(stdout, "%s\n", dump.toLocal8Bit().constData()); + + return false; } return true;