client: Don't store the list of properties in every PropertyMapItem
[quassel.git] / src / client / client.cpp
index c3c4385..87fa59f 100644 (file)
@@ -168,6 +168,10 @@ void Client::init()
     connect(this, SIGNAL(connected()), mainUi(), SLOT(connectedToCore()));
     connect(this, SIGNAL(disconnected()), mainUi(), SLOT(disconnectedFromCore()));
 
+    // Listen to network removed events
+    connect(this, SIGNAL(networkRemoved(NetworkId)),
+        _messageProcessor, SLOT(networkRemoved(NetworkId)));
+
     // attach backlog manager
     p->synchronize(backlogManager());
     connect(backlogManager(), SIGNAL(messagesReceived(BufferId, int)), _messageModel, SLOT(messagesReceived(BufferId, int)));
@@ -214,6 +218,16 @@ void Client::onDbUpgradeInProgress(bool inProgress)
 }
 
 
+void Client::onExitRequested(int exitCode, const QString &reason)
+{
+    if (!reason.isEmpty()) {
+        qCritical() << reason;
+        emit exitRequested(reason);
+    }
+    QCoreApplication::exit(exitCode);
+}
+
+
 /*** Network handling ***/
 
 QList<NetworkId> Client::networkIds()
@@ -434,6 +448,9 @@ void Client::setSyncedToCore()
     Q_ASSERT(!_highlightRuleManager);
     _highlightRuleManager = new HighlightRuleManager(this);
     p->synchronize(highlightRuleManager());
+    // Listen to network removed events
+    connect(this, SIGNAL(networkRemoved(NetworkId)),
+        _highlightRuleManager, SLOT(networkRemoved(NetworkId)));
 
 /*  not ready yet
     // create TransferManager and DccConfig if core supports them