certmanager/lib
qgpgmeexportjob.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifdef HAVE_CONFIG_H
00034 #include <config.h>
00035 #endif
00036
00037 #include "qgpgmeexportjob.h"
00038
00039 #include <qgpgme/eventloopinteractor.h>
00040 #include <qgpgme/dataprovider.h>
00041
00042 #include <gpgmepp/context.h>
00043 #include <gpgmepp/data.h>
00044
00045 #include <qstringlist.h>
00046
00047 #include <assert.h>
00048
00049 Kleo::QGpgMEExportJob::QGpgMEExportJob( GpgME::Context * context )
00050 : ExportJob( QGpgME::EventLoopInteractor::instance(), "Kleo::QGpgMEExportJob" ),
00051 QGpgMEJob( this, context )
00052 {
00053 assert( context );
00054 }
00055
00056 Kleo::QGpgMEExportJob::~QGpgMEExportJob() {
00057 }
00058
00059 GpgME::Error Kleo::QGpgMEExportJob::start( const QStringList & pats ) {
00060 assert( !patterns() );
00061 assert( !mOutData );
00062
00063 createOutData();
00064 setPatterns( pats );
00065 hookupContextToEventLoopInteractor();
00066
00067 const GpgME::Error err = mCtx->startPublicKeyExport( patterns(), *mOutData );
00068
00069 if ( err )
00070 deleteLater();
00071 return err;
00072 }
00073
00074 void Kleo::QGpgMEExportJob::doOperationDoneEvent( const GpgME::Error & error ) {
00075 emit result( error, mOutDataDataProvider->data() );
00076 }
00077
00078 #include "qgpgmeexportjob.moc"
|