diff options
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__ |