summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-10 13:31:39 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-10 13:31:39 (GMT)
commit29e4e51e21b8902c82456cc85af46fa5f5889f04 (patch)
tree5ad1d62b82effb59d46d92a272b3ebe998ce6e08 /Swift
parentfb7fe3dd7cf48b0e4a7337212129520dff5a236d (diff)
downloadswift-29e4e51e21b8902c82456cc85af46fa5f5889f04.zip
swift-29e4e51e21b8902c82456cc85af46fa5f5889f04.tar.bz2
Refactor responders to only start on start().
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/MainController.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 41c5581..48cceca 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -196,10 +196,16 @@ void MainController::resetClient() {
serverDiscoInfo_ = boost::shared_ptr<DiscoInfo>();
delete mucSearchController_;
mucSearchController_ = NULL;
- delete discoResponder_;
- discoResponder_ = NULL;
- delete clientVersionResponder_;
- clientVersionResponder_ = NULL;
+ if (discoResponder_) {
+ discoResponder_->stop();
+ delete discoResponder_;
+ discoResponder_ = NULL;
+ }
+ if (clientVersionResponder_) {
+ clientVersionResponder_->stop();
+ delete clientVersionResponder_;
+ clientVersionResponder_ = NULL;
+ }
delete eventWindowController_;
eventWindowController_ = NULL;
delete xmppRosterController_;
@@ -288,6 +294,7 @@ void MainController::handleConnected() {
eventWindowController_ = new EventWindowController(eventController_, eventWindowFactory_);
clientVersionResponder_ = new SoftwareVersionResponder(CLIENT_NAME, buildVersion, client_->getIQRouter());
+ clientVersionResponder_->start();
loginWindow_->morphInto(rosterController_->getWindow());
DiscoInfo discoInfo;
@@ -299,6 +306,7 @@ void MainController::handleConnected() {
discoResponder_ = new DiscoInfoResponder(client_->getIQRouter());
discoResponder_->setDiscoInfo(discoInfo);
discoResponder_->setDiscoInfo(capsInfo_->getNode() + "#" + capsInfo_->getVersion(), discoInfo);
+ discoResponder_->start();
serverDiscoInfo_ = boost::shared_ptr<DiscoInfo>(new DiscoInfo());
mucSearchController_ = new MUCSearchController(jid_, uiEventStream_, mucSearchWindowFactory_, client_->getIQRouter());