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

List:       kde-commits
Subject:    branches/KDE/3.5/kdenetwork/kopete/libkopete
From:       Olivier Goffart <ogoffart () kde ! org>
Date:       2005-08-25 17:42:53
Message-ID: 1124991773.838561.22386.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 453262 by ogoffart:

Only try to connect 3 times

 M  +9 -1      kopeteaccount.cpp  


--- branches/KDE/3.5/kdenetwork/kopete/libkopete/kopeteaccount.cpp #453261:453262
@@ -59,6 +59,7 @@
 	 , excludeconnect( true ), priority( 0 ), myself( 0 )
 	 , suppressStatusTimer( 0 ), suppressStatusNotification( false )
 	 , blackList( new Kopete::BlackLister( protocol->pluginId(), accountId ) )
+	 , connectionTry(0)
 	{ }
 
 
@@ -76,6 +77,7 @@
 	bool suppressStatusNotification;
 	Kopete::BlackLister *blackList;
 	KConfigGroup *configGroup;
+	uint connectionTry;
 };
 
 Account::Account( Protocol *parent, const QString &accountId, const char *name )
@@ -113,8 +115,11 @@
 	if ( ( KopetePrefs::prefs()->reconnectOnDisconnect() == true && reason > Manual ) ||
 	     reason == BadPassword )
 	{
+		if(reason != BadPassword) 
+			d->connectionTry++;
 		//use a timer to allow the plugins to clean up after return
-		QTimer::singleShot(0, this, SLOT(connect()));
+		if(d->connectionTry < 3)
+			QTimer::singleShot( 0, this, SLOT(connect()));
 	}
 	if(reason== OtherClient)
 	{
@@ -405,6 +410,7 @@
 		// connection's speed and your computer's speed you *will* need it.
 		d->suppressStatusNotification = true;
 		d->suppressStatusTimer.start( 5000, true );
+		//the timer is also used to reset the d->connectionTry
 	}
 
 /*	kdDebug(14010) << k_funcinfo << "account " << d->id << " changed status. was "
@@ -427,6 +433,8 @@
 void Account::slotStopSuppression()
 {
 	d->suppressStatusNotification = false;
+	if(isConnected())
+		d->connectionTry=0;
 }
 
 bool Account::suppressStatusNotification() const
[prev in list] [next in list] [prev in thread] [next in thread] 

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