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

List:       kde-commits
Subject:    proko2: kdepim/certmanager/lib
From:       Marc Mutz <mutz () kde ! org>
Date:       2005-04-05 9:54:34
Message-ID: 20050405095434.E62F063E () office ! kde ! org
[Download RAW message or body]

CVS commit by mutz: 

Implement ObtainKeysJob, which replaces KeyListJob for Chiasmus. Chiasmus is not \
really a public-key cryptosystem, and trying to adapt GpgME::Key to it would be \
futile.


  A            backends/chiasmus/obtainkeysjob.cpp   1.1.2.1 [GPL (v2+) (+Qt \
exception)]  A            backends/chiasmus/obtainkeysjob.h   1.1.2.1 [GPL (v2+) (+Qt \
exception)]  M +2 -1      backends/chiasmus/Makefile.am   1.1.2.2
  M +18 -2     backends/chiasmus/chiasmusbackend.cpp   1.1.2.6
  M +4 -13     kleo/specialjob.h   1.1.2.2


--- kdepim/certmanager/lib/backends/chiasmus/Makefile.am  #1.1.2.1:1.1.2.2
@@ -1,3 +1,3 @@
-INCLUDES = -I$(top_srcdir)/certmanager/lib $(all_includes)
+INCLUDES = -I$(top_srcdir)/certmanager/lib -I$(top_srcdir)/libkdenetwork \
$(all_includes)  
 noinst_LTLIBRARIES = libkleopatra_backend_chiasmus.la
@@ -5,4 +5,5 @@
 libkleopatra_backend_chiasmus_la_SOURCES = \
                         config_data.c \
+                        obtainkeysjob.cpp \
                         chiasmusbackend.cpp
 

--- kdepim/certmanager/lib/backends/chiasmus/chiasmusbackend.cpp  #1.1.2.5:1.1.2.6
@@ -38,4 +38,5 @@
 
 #include "config_data.h"
+#include "obtainkeysjob.h"
 
 #include "kleo/cryptoconfig.h"
@@ -340,5 +341,13 @@ public:
 
 class Kleo::ChiasmusBackend::Protocol : public Kleo::CryptoBackend::Protocol {
+  Kleo::CryptoConfig * mCryptoConfig;
 public:
+  Protocol( Kleo::CryptoConfig * config )
+    : Kleo::CryptoBackend::Protocol(), mCryptoConfig( config )
+  {
+    assert( config );
+  }
+  ~Protocol() {}
+
   QString name() const { return "Chiasmus"; }
   QString displayName() const { return i18n( "Chiasmus command line tool" ); }
@@ -359,5 +368,12 @@ public:
   RefreshKeysJob * refreshKeysJob() const { return 0; }
 
-  SpecialJob * specialJob( const char *, const QMap<QString,QVariant> & ) const { \
return 0; } +  SpecialJob * specialJob( const char * type, const \
QMap<QString,QVariant> & args ) const { +    if ( qstricmp( type, "x-obtain-keys" ) \
== 0 && args.size() == 0 ) { +      CryptoConfigEntry * entry = mCryptoConfig->entry( \
"Chiasmus", "General", "keydir" ); +      assert( entry );
+      return new ObtainKeysJob( entry->urlValue().path() ); // FIXME: allow more \
than one keypath +    }
+    return 0;
+  }
 };
 
@@ -394,5 +410,5 @@ Kleo::CryptoBackend::Protocol * Kleo::Ch
   if ( !mProtocol )
     if ( checkForChiasmus() )
-      mProtocol = new Protocol();
+      mProtocol = new Protocol( config() );
   return mProtocol;
 }

--- kdepim/certmanager/lib/kleo/specialjob.h  #1.1.2.1:1.1.2.2
@@ -64,21 +64,12 @@ namespace Kleo {
 
      /**
-       Starts the special operation. \a pattern is a list of patterns
-       used to restrict the list of keys returned. Empty patterns are
-       ignored. If \a pattern is empty or contains only empty strings,
-       all keys are returned (however, the backend is free to truncate
-       the result and should do so; when this happens, it will be
-       reported by the reult object).
-
-       If \a secretOnly is true, only keys for which the secret key is
-       also available are returned. Use this if you need to select a
-       key for signing.
+       Starts the special operation.
     */
     virtual GpgME::Error start() = 0;
 
-    virtual GpgME::Error exec() = 0;
+    virtual GpgME::Error exec( QVariant * result ) = 0;
 
   signals:
-    void result( const GpgME::Error & result );
+    void result( const GpgME::Error & result, const QVariant & data );
   };
 


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

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