certmanager/lib

Kleo::QGpgMEJob Class Reference

#include <qgpgmejob.h>

Inheritance diagram for Kleo::QGpgMEJob:

Kleo::QGpgMEDecryptJob Kleo::QGpgMEDecryptVerifyJob Kleo::QGpgMEDeleteJob Kleo::QGpgMEDownloadJob Kleo::QGpgMEEncryptJob Kleo::QGpgMEExportJob Kleo::QGpgMEImportJob Kleo::QGpgMEKeyGenerationJob Kleo::QGpgMEKeyListJob Kleo::QGpgMESignEncryptJob Kleo::QGpgMESignJob Kleo::QGpgMEVerifyDetachedJob Kleo::QGpgMEVerifyOpaqueJob List of all members.

Detailed Description

This is a hackish helper class to avoid code duplication in this backend's Kleo::Job subclasses.

It contains several workarounds for moc/signal/slot shortcomings, most of which the author of this thinks are Qt bugs (lazy implementations), first and foremost the inability of moc to handle inheritance from multiple QObject-derived subclasses.

To use it, inherit from the Job-subclass, then from this class, add QGPGME_JOB to just after Q OBJECT and implement doOperationDoneEvent() by emitting your variant of the result() signal there. Pass "this" as the first argument this QGpgMEJOb's ctor. The rest is dealt with automatically.

Definition at line 78 of file qgpgmejob.h.


Public Member Functions

 QGpgMEJob (Kleo::Job *_this, GpgME::Context *context)
 ~QGpgMEJob ()
void checkInvariants () const

Protected Member Functions

virtual void doOperationDoneEvent (const GpgME::Error &e)=0
void hookupContextToEventLoopInteractor ()
void setPatterns (const QStringList &sl, bool allowEmpty=false)
unsigned int numPatterns () const
const char ** nextChunk ()
const char ** patterns () const
void setChunkSize (unsigned int size)
unsigned int chunkSize () const
void createOutData ()
void createInData (const QByteArray &in)
GpgME::Error setSigningKeys (const std::vector< GpgME::Key > &signers)
void doSlotOperationDoneEvent (GpgME::Context *context, const GpgME::Error &e)
virtual void doEmitProgressSignal (const QString &what, int current, int total)=0
virtual void doEmitDoneSignal ()=0
void doSlotCancel ()

Protected Attributes

Kleo::JobmThis
GpgME::Context * mCtx
GpgME::Data * mInData
QGpgME::QByteArrayDataProvider * mInDataDataProvider
GpgME::Data * mOutData
QGpgME::QByteArrayDataProvider * mOutDataDataProvider

Member Function Documentation

virtual void Kleo::QGpgMEJob::doOperationDoneEvent ( const GpgME::Error &  e  )  [protected, pure virtual]

Called on operation-done events, between emitting done() and calling deleteLater(). You should emit your result signal here.

void Kleo::QGpgMEJob::hookupContextToEventLoopInteractor (  )  [protected]

Hooks up mCtx to be managed by the event loop interactor

Definition at line 152 of file qgpgmejob.cpp.

void Kleo::QGpgMEJob::setPatterns ( const QStringList &  sl,
bool  allowEmpty = false 
) [protected]

Fills mPatterns from the stringlist, resets chunking to the full list

Definition at line 159 of file qgpgmejob.cpp.

unsigned int Kleo::QGpgMEJob::numPatterns (  )  const [inline, protected]

Returnes the number of patterns set

Definition at line 92 of file qgpgmejob.h.

const char ** Kleo::QGpgMEJob::nextChunk (  )  [protected]

Skips to the next chunk of patterns.

Returns:
patterns()

Definition at line 192 of file qgpgmejob.cpp.

const char ** Kleo::QGpgMEJob::patterns (  )  const [protected]

Returns:
patterns, offset by the current chunk

Definition at line 207 of file qgpgmejob.cpp.

void Kleo::QGpgMEJob::setChunkSize ( unsigned int  size  )  [protected]

Set the current pattern chunksize to size and reset the chunk index to zero

Definition at line 179 of file qgpgmejob.cpp.

unsigned int Kleo::QGpgMEJob::chunkSize (  )  const [inline, protected]

Returns:
current chunksize

Definition at line 100 of file qgpgmejob.h.

void Kleo::QGpgMEJob::createOutData (  )  [protected]

Creates an empty GpgME::Data/QGpgMEQByteArrayDataProvider pair

Definition at line 231 of file qgpgmejob.cpp.

void Kleo::QGpgMEJob::createInData ( const QByteArray &  in  )  [protected]

Creates a GpgME::Data/QGpgMEQByteArrayDataProvider pair, filled with the contents of in

Definition at line 225 of file qgpgmejob.cpp.

GpgME::Error Kleo::QGpgMEJob::setSigningKeys ( const std::vector< GpgME::Key > &  signers  )  [protected]

Sets the list of signing keys

Definition at line 214 of file qgpgmejob.cpp.

void Kleo::QGpgMEJob::doSlotOperationDoneEvent ( GpgME::Context *  context,
const GpgME::Error &  e 
) [protected]

Call this to implement a slotOperationDoneEvent()

Definition at line 237 of file qgpgmejob.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys