diff options
author | Andre Heinecke <[email protected]> | 2020-02-12 10:52:24 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2020-02-12 10:57:09 +0000 |
commit | 77feaa451074741c2d07051915bc23d8b8377242 (patch) | |
tree | 0e2b1e3b55d0dfde24e001eaa15ddb8b5ae0e530 /lang/qt/src/qgpgmebackend.cpp | |
parent | Do not test for a bug in older GnuPG versions (diff) | |
download | gpgme-77feaa451074741c2d07051915bc23d8b8377242.tar.gz gpgme-77feaa451074741c2d07051915bc23d8b8377242.zip |
qt: Add GpgCardJob following the job pattern
* lang/qt/src/Makefile.am: Add new files.
* lang/qt/src/job.cpp (GpgCardJob): Add impl stuff.
* lang/qt/src/protocol.h (gpgCardJob): Get one.
* lang/qt/src/qgpgmebackend.cpp,
lang/qt/src/qgpgmebackend.h: Add helpers to get the job.
* lang/qt/src/qgpgmegpgcardjob.cpp,
lang/qt/src/gpgcardjob.h,
lang/qt/src/qgpgmegpgcardjob.h: New.
--
This is annoyingly complex to add a simple new job.
In the future we should implement something like this
without the threadedjobmixin stuff. But the idea was
to follow the usual job pattern.
GnuPG-Bug-Id: T4794
Diffstat (limited to 'lang/qt/src/qgpgmebackend.cpp')
-rw-r--r-- | lang/qt/src/qgpgmebackend.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lang/qt/src/qgpgmebackend.cpp b/lang/qt/src/qgpgmebackend.cpp index f7393f09..aa96db0d 100644 --- a/lang/qt/src/qgpgmebackend.cpp +++ b/lang/qt/src/qgpgmebackend.cpp @@ -38,6 +38,7 @@ #include "qgpgmebackend.h" +#include "qgpgmegpgcardjob.h" #include "error.h" #include "engineinfo.h" @@ -86,6 +87,11 @@ QGpgME::CryptoConfig *QGpgME::QGpgMEBackend::config() const return mCryptoConfig; } +QGpgME::GpgCardJob *QGpgME::QGpgMEBackend::gpgCardJob() const +{ + return new QGpgME::QGpgMEGpgCardJob(); +} + static bool check(GpgME::Protocol proto, QString *reason) { if (!GpgME::checkEngine(proto)) { @@ -206,3 +212,11 @@ QGpgME::Protocol *QGpgME::smime() } return gpgmeBackend->smime(); } + +QGpgME::GpgCardJob *QGpgME::gpgCardJob () +{ + if (!gpgmeBackend) { + gpgmeBackend = new QGpgME::QGpgMEBackend(); + } + return gpgmeBackend->gpgCardJob(); +} |