[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdepim/certmanager/lib
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2004-03-15 15:42:43
Message-ID: 20040315154243.D73089982 () office ! kde ! org
[Download RAW message or body]

CVS commit by mutz: 

Add exec(), which is a sync equivalent to start().


  M +18 -1     backends/qgpgme/qgpgmekeylistjob.cpp   1.7
  M +5 -1      backends/qgpgme/qgpgmekeylistjob.h   1.5
  M +4 -0      kleo/keylistjob.h   1.5


--- kdepim/certmanager/lib/backends/qgpgme/qgpgmekeylistjob.cpp  #1.6:1.7
@@ -66,5 +66,5 @@ Kleo::QGpgMEKeyListJob::~QGpgMEKeyListJo
 }
 
-GpgME::Error Kleo::QGpgMEKeyListJob::start( const QStringList & patterns, bool \
secretOnly ) { +void Kleo::QGpgMEKeyListJob::setup( const QStringList & patterns ) {
   assert( !mPatterns );
 
@@ -78,4 +78,8 @@ GpgME::Error Kleo::QGpgMEKeyListJob::sta
   }
   *pat_it++ = 0;
+}
+
+GpgME::Error Kleo::QGpgMEKeyListJob::start( const QStringList & patterns, bool \
secretOnly ) { +  setup( patterns );
 
   // hook up the context to the eventloopinteractor:
@@ -95,4 +99,17 @@ GpgME::Error Kleo::QGpgMEKeyListJob::sta
 }
 
+GpgME::KeyListResult Kleo::QGpgMEKeyListJob::exec( const QStringList & patterns, \
bool secretOnly, std::vector<GpgME::Key> & keys ) { +  keys.clear();
+  setup( patterns );
+  GpgME::Error err = mCtx->startKeyListing( mPatterns, secretOnly );
+  if ( !err ) {
+    do
+      keys.push_back( mCtx->nextKey( err ) );
+    while ( !err );
+    keys.pop_back();
+  }
+  return mCtx->endKeyListing();
+}
+
 void Kleo::QGpgMEKeyListJob::slotNextKeyEvent( GpgME::Context * context, const \
GpgME::Key & key ) {  if ( context == mCtx )

--- kdepim/certmanager/lib/backends/qgpgme/qgpgmekeylistjob.h  #1.4:1.5
@@ -52,7 +52,10 @@ namespace Kleo {
     ~QGpgMEKeyListJob();
 
-    /*! \reimp from KeyLister */
+    /*! \reimp from KeyListJob */
     GpgME::Error start( const QStringList & patterns, bool secretOnly );
 
+    /*! \reimp from KeyListJob */
+    GpgME::KeyListResult exec( const QStringList & patterns, bool secretOnly, \
std::vector<GpgME::Key> & keys ); +
   private slots:
     void slotNextKeyEvent( GpgME::Context * context, const GpgME::Key & key );
@@ -64,4 +67,5 @@ namespace Kleo {
     /*! \reimp from GpgME::ProgressProvider */
     void showProgress( const char * what, int type, int current, int total );
+    void setup( const QStringList & );
 
   private:

--- kdepim/certmanager/lib/kleo/keylistjob.h  #1.4:1.5
@@ -36,4 +36,6 @@
 #include "job.h"
 
+#include <vector>
+
 namespace GpgME {
   class Error;
@@ -82,4 +84,6 @@ namespace Kleo {
     virtual GpgME::Error start( const QStringList & patterns, bool secretOnly=false \
) = 0;  
+    virtual GpgME::KeyListResult exec( const QStringList & patterns, bool \
secretOnly, std::vector<GpgME::Key> & keys ) = 0; +
   signals:
     void nextKey( const GpgME::Key & key );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic