- Network Connection state is now reflected in the BufferViews
[quassel.git] / src / client / networkmodel.cpp
index 12e51e5..920b2d8 100644 (file)
@@ -228,7 +228,7 @@ void BufferItem::removeUserFromCategory(IrcUser *ircUser) {
   }
 
   
-  if(!success || success) {
+  if(!success) {
     qDebug() << "==== Childlist for Item:" << this << id() << bufferName() << "====";
     for(int i = 0; i < childCount(); i++) {
       categoryItem = qobject_cast<UserCategoryItem *>(child(i));
@@ -283,8 +283,16 @@ quint64 NetworkItem::id() const {
   return _networkId.toInt();
 }
 
+void NetworkItem::setActive(bool connected) {
+  Q_UNUSED(connected);
+  emit dataChanged();
+}
+
 bool NetworkItem::isActive() const {
-  return _network;
+  if(_network)
+    return _network->isConnected();
+  else
+    return false;
 }
 
 QString NetworkItem::networkName() const {
@@ -320,6 +328,9 @@ void NetworkItem::attachNetwork(Network *network) {
          this, SLOT(setCurrentServer(QString)));
   connect(network, SIGNAL(ircChannelAdded(QString)),
          this, SLOT(attachIrcChannel(QString)));
+  connect(network, SIGNAL(connectedSet(bool)),
+         this, SLOT(setActive(bool)));
+  
   // FIXME: connect this and that...
 
   emit dataChanged();