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

List:       kde-commits
Subject:    branches/KDE/3.4/kdenetwork/kopete/protocols/irc/ui
From:       Tommi Rantala <tommi.rantala () cs ! helsinki ! fi>
Date:       2005-08-09 14:09:25
Message-ID: 1123596565.415227.8834.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 444260 by rantala:

backport:
Fix two broken signal connections.


 M  +24 -12    channellist.cpp  
 M  +2 -5      channellist.h  


--- branches/KDE/3.4/kdenetwork/kopete/protocols/irc/ui/channellist.cpp #444259:444260
@@ -226,8 +226,8 @@
 
 	connect( m_engine, SIGNAL( incomingEndOfList() ), this, SLOT( slotListEnd() ) );
 
-	connect( m_engine, SIGNAL( connectedToServer() ), this, SLOT( reset() ) );
-	connect( m_engine, SIGNAL( disconnected() ), this, SLOT( slotDisconnected() ) );
+	connect( m_engine, SIGNAL( statusChanged(KIRC::Engine::Status) ),
+			this, SLOT( slotStatusChanged(KIRC::Engine::Status) ) );
 
 	show();
 }
@@ -242,6 +242,28 @@
 	emit channelSelected( i->text(0) );
 }
 
+void ChannelList::slotStatusChanged(KIRC::Engine::Status newStatus)
+{
+	switch(newStatus) {
+	case KIRC::Engine::Connected:
+		this->reset();
+		break;
+	case KIRC::Engine::Disconnected:
+		if (mSearching) {
+			KMessageBox::queuedMessageBox(
+				this, KMessageBox::Error,
+				i18n("You have been disconnected from the IRC server."),
+				i18n("Disconnected"), 0
+				);
+		}
+
+		slotListEnd();
+		break;
+	default:
+		break;
+	}
+}
+
 void ChannelList::reset()
 {
 	channelCache.clear();
@@ -314,16 +336,6 @@
 	}
 }
 
-void ChannelList::slotDisconnected()
-{
-	KMessageBox::queuedMessageBox(
-		this, KMessageBox::Error, i18n("You have been disconnected from the IRC server."),
-		i18n("Disconnected"), 0
-	);
-
-	slotListEnd();
-}
-
 void ChannelList::slotListEnd()
 {
 	mChannelList->setSorting(0, true);
--- branches/KDE/3.4/kdenetwork/kopete/protocols/irc/ui/channellist.h #444259:444260
@@ -22,10 +22,7 @@
 #include <qmap.h>
 #include <qpair.h>
 
-namespace KIRC
-{
-class Engine;
-}
+#include "kircengine.h"
 
 class QVBoxLayout;
 class QHBoxLayout;
@@ -59,8 +56,8 @@
 		void slotItemSelected( QListViewItem * i );
 		void slotChannelListed( const QString & channel, uint users, const QString & topic );
 		void slotListEnd();
-		void slotDisconnected();
 		void slotSearchCache();
+		void slotStatusChanged( KIRC::Engine::Status );
 
 	private:
 		void checkSearchResult( const QString & channel, uint users, const QString & topic );
[prev in list] [next in list] [prev in thread] [next in thread] 

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