Home GnuPG
Diffusion GPGME 40ca3d589638

qt: Clean up after failure or cancel of sign/encrypt archive operation

Description

qt: Clean up after failure or cancel of sign/encrypt archive operation

* lang/qt/src/qgpgmeencryptarchivejob.cpp (encrypt): Remove output file
if operation was canceled or failed.
* lang/qt/src/qgpgmesignarchivejob.cpp (sign): Ditto.
* lang/qt/src/qgpgmesignencryptarchivejob.cpp (sign_encrypt): Ditto.
* lang/qt/tests/run-encryptarchivejob.cpp (CommandLineOptions): Add
field cancelTimeout.
(parseCommandLine): Add option --cancel-after. Parse option value.
(main): Check for invalid cancel timeout. Start timer for canceling
the job.
* lang/qt/tests/run-signarchivejob.cpp (CommandLineOptions): Add
field cancelTimeout.
(parseCommandLine): Add option --cancel-after. Parse option value.
(main): Check for invalid cancel timeout. Start timer for canceling
the job.

This change ensures that the output file is removed if the creation of
a signed or encrypted archive was canceled or failed. The new option
of the test runners enables testing the cancelation of the jobs.

Details

Provenance
ikloeckerAuthored on Aug 16 2023, 2:23 PM
Parents
rMc3171d0cf1a2: qt: Make toLogString helper public
Branches
Unknown
Tags
Unknown
Tasks
T6584: Kleopatra / Gpgtar: Cancel on encrypt leaves a broken archive behind