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

List:       kde-commits
Subject:    kdepim/certmanager/lib/kleo
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2004-04-27 7:01:34
Message-ID: 20040427070134.8CB849A72 () office ! kde ! org
[Download RAW message or body]

CVS commit by mutz: 

Optimisation: When the inital pattern doesn't consist of a list of fingerprints, but \
is the empty list (e.g. when listing in Kleopatra), we would fetch intermediate CA \
keys twice, since the scheduled-set would have no intersection with the \
next-to-fetch-set. The fix is to remove the sent-set from the next-set, too.


  M +7 -4      hierarchicalkeylistjob.cpp   1.2


--- kdepim/certmanager/lib/kleo/hierarchicalkeylistjob.cpp  #1.1:1.2
@@ -98,9 +98,13 @@ void Kleo::HierarchicalKeyListJob::slotR
   mJob = 0;
   mIntermediateResult.mergeWith( res );
-  std::set<QString> s;
+  std::set<QString> tmp;
   std::set_difference( mNextSet.begin(), mNextSet.end(),
                        mScheduledSet.begin(), mScheduledSet.end(),
-                       std::inserter( s, s.begin() ) );
-  if ( mIntermediateResult.error() || s.empty() ) {
+                       std::inserter( tmp, tmp.begin() ) );
+  mNextSet.clear();
+  std::set_difference( tmp.begin(), tmp.end(),
+                       mSentSet.begin(), mSentSet.end(),
+                       std::inserter( mNextSet, mNextSet.begin() ) );
+  if ( mIntermediateResult.error() || mNextSet.empty() ) {
     emit done();
     emit result( mIntermediateResult );
@@ -108,5 +112,4 @@ void Kleo::HierarchicalKeyListJob::slotR
     return;
   }
-  mNextSet = s;
   if ( const GpgME::Error error = startAJob() ) { // error starting the job for next \
keys  mIntermediateResult.mergeWith( GpgME::KeyListResult( error ) );


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

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