diff options
author | Ingo Klöcker <[email protected]> | 2023-02-13 14:56:20 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2023-02-14 08:25:21 +0000 |
commit | 73e46b34658c0130de5ab9e3f4ce1ac4ee35c5e2 (patch) | |
tree | ad6e4e0a9a17fc4dc491196447aa0e8a945a9d14 /lang/qt/src/job_p.h | |
parent | qt: Remove commented out code (diff) | |
download | gpgme-73e46b34658c0130de5ab9e3f4ce1ac4ee35c5e2.tar.gz gpgme-73e46b34658c0130de5ab9e3f4ce1ac4ee35c5e2.zip |
qt: Add signals for file-based and data-based progress
* lang/qt/src/decryptverifyarchivejob.h (DecryptVerifyArchiveJob): Add
signals fileProgress and dataProgress.
* lang/qt/src/encryptarchivejob.h (EncryptArchiveJob): Ditto.
* lang/qt/src/signarchivejob.h (SignArchiveJob): Ditto.
* lang/qt/src/signencryptarchivejob.h (SignEncryptArchiveJob): Ditto.
* lang/qt/src/job_p.h (emitArchiveProgressSignals): New.
* lang/qt/src/qgpgmedecryptverifyarchivejob.cpp
(QGpgMEDecryptVerifyArchiveJob::QGpgMEDecryptVerifyArchiveJob): Emit
appropriate signal when receiving Job::rawProgress signal.
* lang/qt/src/qgpgmeencryptarchivejob.cpp
(QGpgMEEncryptArchiveJob::QGpgMEEncryptArchiveJob): Ditto.
* lang/qt/src/qgpgmesignarchivejob.cpp
(QGpgMESignArchiveJob::QGpgMESignArchiveJob): Ditto.
* lang/qt/src/qgpgmesignencryptarchivejob.cpp
(QGpgMESignEncryptArchiveJob::QGpgMESignEncryptArchiveJob): Ditto.
--
GnuPG-bug-id: 6342
Diffstat (limited to 'lang/qt/src/job_p.h')
-rw-r--r-- | lang/qt/src/job_p.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lang/qt/src/job_p.h b/lang/qt/src/job_p.h index ff99d6ea..7d0f9952 100644 --- a/lang/qt/src/job_p.h +++ b/lang/qt/src/job_p.h @@ -36,6 +36,8 @@ #include "job.h" +#include "qgpgme_debug.h" + #include <memory> namespace QGpgME @@ -62,6 +64,25 @@ static T *jobPrivate(const Job *job) { return dynamic_cast<T *>(d); } +// Helper for the archive job classes +template<class JobClass> +void emitArchiveProgressSignals(JobClass *job, const QString &what, int type, int current, int total) +{ + if (what != QLatin1String{"gpgtar"}) { + return; + } + switch (type) { + case 'c': + Q_EMIT job->fileProgress(current, total); + break; + case 's': + Q_EMIT job->dataProgress(current, total); + break; + default: + qCDebug(QGPGME_LOG) << job << __func__ << "Received progress for gpgtar with unknown type" << char(type); + }; +} + } #endif // __QGPGME_JOB_P_H__ |