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

List:       kde-commits
Subject:    kdenonbeta/kopete/libkopete
From:       Martijn Klingens <klingens () kde ! org>
Date:       2003-07-22 13:43:23
[Download RAW message or body]

CVS commit by mklingens: 

don't use QPtrList::next() and ::current() to iterate over a list within
different contexts, use iterators. I wonder why these methods exist at all,
this is not the first time they break stuff...


  M +6 -3      kopeteaccountmanager.cpp   1.26


--- kdenonbeta/kopete/libkopete/kopeteaccountmanager.cpp  #1.25:1.26
@@ -282,8 +282,11 @@ void KopeteAccountManager::slotPluginLoa
 void KopeteAccountManager::autoConnect()
 {
-        for(KopeteAccount *i=m_accounts.first() ; i; i=m_accounts.next() )
+        QPtrListIterator<KopeteAccount> it( m_accounts );
+        KopeteAccount *account;
+        while ( ( account = it.current() ) != 0 )
         {
-                if(i->autoLogin())
-                        i->connect();
+                ++it;
+                if( account->autoLogin() )
+                        account->connect();
         }
 }


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

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