aboutsummaryrefslogtreecommitdiffstats
path: root/lang/qt/src/decryptverifyjob.h
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2023-12-21 10:53:23 +0000
committerIngo Klöcker <[email protected]>2023-12-22 09:01:17 +0000
commit20b32e03503f8c3187508d9cd5ba07db2b03f014 (patch)
tree16eae3b81c8c584ae98a958549e5920bd982cd7c /lang/qt/src/decryptverifyjob.h
parentqt: Support writing/reading signed/encrypted files directly to/from file (diff)
downloadgpgme-20b32e03503f8c3187508d9cd5ba07db2b03f014.tar.gz
gpgme-20b32e03503f8c3187508d9cd5ba07db2b03f014.zip
qt: Support decryption (with verification) directly to/from files
* lang/qt/src/Makefile.am: Add new files. * lang/qt/src/job.cpp (DecryptVerifyJob): Move definition of constructor and destructor and inclusion of the moc file to the corresponding .cpp file. * lang/qt/src/decryptverifyjob.cpp: New. * lang/qt/src/decryptverifyjob.h (DecryptVerifyJob): Add member functions setInputFile, inputFile, setOutputFile, outputFile. * lang/qt/src/decryptverifyjob_p.h: New. * lang/qt/src/qgpgmedecryptverifyjob.cpp (class QGpgMEDecryptVerifyJobPrivate): New. (QGpgMEDecryptVerifyJob::QGpgMEDecryptVerifyJob): Instantiate private job class. (decrypt_verify_from_filename): New. * lang/qt/tests/Makefile.am: Add new test program. * lang/qt/tests/run-decryptverifyjob.cpp: New. -- This makes it possible to tell gpg to read the input and write the output directly to a specified file bypassing GpgME's Data IO when decrypting (and verifying) a file. GnuPG-bug-id: 6550
Diffstat (limited to '')
-rw-r--r--lang/qt/src/decryptverifyjob.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/lang/qt/src/decryptverifyjob.h b/lang/qt/src/decryptverifyjob.h
index 8444e4d0..710fc80e 100644
--- a/lang/qt/src/decryptverifyjob.h
+++ b/lang/qt/src/decryptverifyjob.h
@@ -62,6 +62,14 @@ namespace QGpgME
DecryptVerifyJob instance will have scheduled it's own destruction with
a call to QObject::deleteLater().
+ Alternatively, the job can be started with startIt() after setting
+ an input file and an output file. If the job is started this way then
+ the backend reads the input and writes the output directly from/to the
+ specified input file and output file. In this case the plainText value of
+ the result signal will always be empty. This direct IO mode is currently
+ only supported for OpenPGP. Note that startIt() does not schedule the job's
+ destruction if starting the job failed.
+
After result() is emitted, the DecryptVerifyJob will schedule it's own
destruction by calling QObject::deleteLater().
*/
@@ -71,7 +79,27 @@ class QGPGME_EXPORT DecryptVerifyJob : public Job
protected:
explicit DecryptVerifyJob(QObject *parent);
public:
- ~DecryptVerifyJob();
+ ~DecryptVerifyJob() override;
+
+ /**
+ * Sets the path of the file to decrypt (and verify).
+ *
+ * Used if the job is started with startIt().
+ */
+ void setInputFile(const QString &path);
+ QString inputFile() const;
+
+ /**
+ * Sets the path of the file to write the result to.
+ *
+ * Used if the job is started with startIt().
+ *
+ * \note If a file with this path exists, then the job will fail, i.e. you
+ * need to delete an existing file that shall be overwritten before you
+ * start the job.
+ */
+ void setOutputFile(const QString &path);
+ QString outputFile() const;
/**
Starts the combined decryption and verification operation.