diff options
| author | Ingo Klöcker <[email protected]> | 2023-01-27 10:53:45 +0000 | 
|---|---|---|
| committer | Ingo Klöcker <[email protected]> | 2023-01-27 11:20:53 +0000 | 
| commit | 7afd135ccec73585e06272f98b4a0895e3ee6579 (patch) | |
| tree | b97a2857f8af57592d440b875705c3ca222eb705 /lang/qt/src/protocol_p.h | |
| parent | qt: Add data provider for list of file names (diff) | |
| download | gpgme-7afd135ccec73585e06272f98b4a0895e3ee6579.tar.gz gpgme-7afd135ccec73585e06272f98b4a0895e3ee6579.zip  | |
qt: Add job for creating encrypted archives
* lang/qt/src/encryptarchivejob.cpp, lang/qt/src/encryptarchivejob.h,
lang/qt/src/encryptarchivejob_p.h,
lang/qt/src/qgpgmeencryptarchivejob.cpp,
lang/qt/src/qgpgmeencryptarchivejob.h: New.
* lang/qt/src/protocol.h (class Protocol): Add pure virtual member
function encryptArchiveJob
* lang/qt/src/protocol_p.h (Protocol::encryptArchiveJob): ... and
implement it.
* lang/qt/src/Makefile.am: Update accordingly.
* lang/qt/tests/run-encryptarchivejob.cpp: New.
* lang/qt/tests/Makefile.am: Add new test runner.
--
GnuPG-bug-id: 6342
Diffstat (limited to '')
| -rw-r--r-- | lang/qt/src/protocol_p.h | 13 | 
1 files changed, 13 insertions, 0 deletions
diff --git a/lang/qt/src/protocol_p.h b/lang/qt/src/protocol_p.h index 915fef99..e6b2b8a8 100644 --- a/lang/qt/src/protocol_p.h +++ b/lang/qt/src/protocol_p.h @@ -46,6 +46,7 @@  #include "qgpgmedeletejob.h"  #include "qgpgmedownloadjob.h"  #include "qgpgmesignencryptjob.h" +#include "qgpgmeencryptarchivejob.h"  #include "qgpgmeencryptjob.h"  #include "qgpgmesignjob.h"  #include "qgpgmesignkeyjob.h" @@ -506,6 +507,18 @@ public:          }          return new QGpgME::QGpgMESetPrimaryUserIDJob{context};      } + +    QGpgME::EncryptArchiveJob *encryptArchiveJob(bool armor) const override +    { +        if (mProtocol != GpgME::OpenPGP) { +            return nullptr; +        } +        if (auto context = GpgME::Context::createForProtocol(mProtocol)) { +            context->setArmor(armor); +            return new QGpgME::QGpgMEEncryptArchiveJob{context}; +        } +        return nullptr; +    }  };  }  | 
