Page MenuHome GnuPG

Kleopatra: Improvements for debug dialog
Testing, NormalPublic

Description

  • Allow typing custom commands into the combobox (with config option for disabling this)
  • Allow defining commands from a config file

Event Timeline

TobiasFella created this task.
ebo added a project: Restricted Project.Oct 16 2024, 4:43 PM
TobiasFella moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Oct 17 2024, 2:55 PM

Implemented in https://invent.kde.org/pim/kleopatra/-/merge_requests/290

Some notes:

  • The config key for disabling custom commands is AllowCustomDebugCommands under General in kleopatrarc (default true)
  • Commands can be defined in kleopatradebugcommandsrc; the format is explained in debugdialog.cpp
  • Custom commands are appended to the list of the combobox (but will be gone after closing the dialog)
  • To work in gpg4win, a change for the build scripts is needed to install kleopatradebugcommandsrc (similar to what it's doing for libkleopatrarc). I'll try to get to it today, but if i don't, it would be best if someone else takes care of that before i'm back
ikloecker added a subscriber: ikloecker.

Backported for vsd33

Applied Tobias installation patch to gpg4win master (vsd33)

ebo changed the task status from Open to Testing.Mon, Nov 4, 11:46 AM
ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Fri, Nov 8, 2:09 PM
ebo changed the task status from Testing to Open.Mon, Nov 11, 2:35 PM
ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

Gpg4win-Beta-75: This is in principle ok. Even adding further commands to
C:\Program Files (x86)\Gpg4win\etc\xdg\kleopatradebugcommandsrc works:

But:
When I enter "gpg" + Return in the Input field, 2 gpg processes are started and no output is shown in the output field of the window.
Closing the window is then followed by a crash:

5484	18119.858606	6460	kleopatra.exe	QProcess: Destroyed while process ("gpg") is still running.
5485	18122.194077	6460	kleopatra.exe	<process started at 14:25:44.877 has terminated with 0xc0000005 (EXCEPTION_ACCESS_VIOLATION)>

The QProcesses we start should be configured with closed stdin so that the started process don't hang waiting for input, e.g. by calling closeWriteChannel() immediately after start(). Or by calling start() with QIODeviceBase::ReadOnly, but, sadly, the documentation of QProcess doesn't document what effect that has.

Hmm, calling QProcess::setStandardInputFile(QProcess::nullDevice()) before start() may be even better than calling closeWriteChannel() after start().

Hmm, calling QProcess::setStandardInputFile(QProcess::nullDevice()) before start() may be even better than calling closeWriteChannel() after start().

Done in https://invent.kde.org/pim/kleopatra/-/merge_requests/319

All changes have been backported for VSD 3.3

ikloecker changed the task status from Open to Testing.Wed, Nov 13, 5:24 PM
ikloecker moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

I guess it's now ready for testing

ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Tue, Nov 26, 12:26 PM

Gpg4win-Beta-94: works.

Could be a bit more refined in the future, but this would be for another ticket.