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

List:       kde-commits
Subject:    kdepim/certmanager/lib/ui
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2004-10-19 10:57:28
Message-ID: 20041019105728.6323E16C2F () office ! kde ! org
[Download RAW message or body]

CVS commit by mutz: 

Optimize key refresh: O(N^2) -> O(NlogN)


  M +5 -9      keylistview.cpp   1.28


--- kdepim/certmanager/lib/ui/keylistview.cpp  #1.27:1.28
@@ -336,11 +336,7 @@ void Kleo::KeyListView::slotRefreshKey( 
   if ( !fpr )
     return;
-  // ### hmm, how about using d->itemMap to find the corresponding item?
-  for ( QListViewItemIterator it( this ) ; it.current() ; ++it )
-    if ( KeyListViewItem * item = lvi_cast<KeyListViewItem>( it.current() ) )
-      if ( qstrcmp( fpr, item->key().primaryFingerprint() ) == 0 ) {
+  if ( KeyListViewItem * item = itemByFingerprint( fpr ) )
         item->setKey ( key );
-        return;
-      }
+  else
   // none found -> add it
   slotAddKey( key );


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

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