Skip to content

Commit

Permalink
add: attempt to write settings dump to the clipboard before quitting
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed Jan 8, 2024
1 parent 99abbe7 commit 9e962ed
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9e962ed

Please sign in to comment.