37 #include "qgpgmedecryptjob.h"
39 #include <qgpgme/eventloopinteractor.h>
40 #include <qgpgme/dataprovider.h>
42 #include <gpgmepp/context.h>
43 #include <gpgmepp/decryptionresult.h>
44 #include <gpgmepp/data.h>
48 Kleo::QGpgMEDecryptJob::QGpgMEDecryptJob( GpgME::Context * context )
49 : DecryptJob( QGpgME::EventLoopInteractor::instance(),
"Kleo::QGpgMEDecryptJob" ),
50 QGpgMEJob( this, context )
55 Kleo::QGpgMEDecryptJob::~QGpgMEDecryptJob() {
58 void Kleo::QGpgMEDecryptJob::setup(
const TQByteArray & cipherText ) {
62 createInData( cipherText );
66 GpgME::Error Kleo::QGpgMEDecryptJob::start(
const TQByteArray & cipherText ) {
69 hookupContextToEventLoopInteractor();
71 const GpgME::Error err = mCtx->startDecryption( *mInData, *mOutData );
78 GpgME::DecryptionResult Kleo::QGpgMEDecryptJob::exec(
const TQByteArray & cipherText,
79 TQByteArray & plainText ) {
81 const GpgME::DecryptionResult result = mCtx->decrypt( *mInData, *mOutData );
82 plainText = mOutDataDataProvider->data();
87 void Kleo::QGpgMEDecryptJob::doOperationDoneEvent(
const GpgME::Error & ) {
88 const GpgME::DecryptionResult res = mCtx->decrypt( *mInData, *mOutData );
89 const TQByteArray plainText = mOutDataDataProvider->data();
91 emit result( res, plainText );
94 #include "qgpgmedecryptjob.moc"