This should take care of it the clean way. Sput please check (I don't have a compiler...
[quassel.git] / src / client / client.cpp
index 28df087..8bbafb2 100644 (file)
@@ -326,6 +326,7 @@ void Client::syncToCore(const QVariant &coreState) {
   
   instance()->connectedToCore = true;
   updateCoreConnectionProgress();
+
 }
 
 void Client::updateCoreConnectionProgress() {
@@ -379,12 +380,12 @@ void Client::updateCoreConnectionProgress() {
   }
 
   emit coreConnectionProgress(1,1);
-  emit connected();
+  emit connected(); // FIXME EgS: This caused the double backlog... but... we shouldn't be calling this whole function all the time...
 
   foreach(NetworkInfo *net, networkInfos()) {
     disconnect(net, 0, this, SLOT(updateCoreConnectionProgress()));
   }
-  
+
   // signalProxy()->dumpProxyStats();
 }
 
@@ -441,10 +442,13 @@ void Client::networkConnected(uint netid) {
   //Buffer *b = buffer(id);
   //b->setActive(true);
 
+  // FIXME EgS: do we really need to call updateCoreConnectionProgress whenever a new network is connected?
   NetworkInfo *netinfo = new NetworkInfo(netid, signalProxy(), this);
-  connect(netinfo, SIGNAL(initDone()), this, SLOT(updateCoreConnectionProgress()));
-  connect(netinfo, SIGNAL(ircUserInitDone()), this, SLOT(updateCoreConnectionProgress()));
-  connect(netinfo, SIGNAL(ircChannelInitDone()), this, SLOT(updateCoreConnectionProgress()));
+  if(!isConnected()) {
+    connect(netinfo, SIGNAL(initDone()), this, SLOT(updateCoreConnectionProgress()));
+    connect(netinfo, SIGNAL(ircUserInitDone()), this, SLOT(updateCoreConnectionProgress()));
+    connect(netinfo, SIGNAL(ircChannelInitDone()), this, SLOT(updateCoreConnectionProgress()));
+  }
   connect(netinfo, SIGNAL(destroyed()), this, SLOT(networkInfoDestroyed()));
   _networkInfo[netid] = netinfo;
 }