summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/MainController.cpp')
-rw-r--r--Swift/Controllers/MainController.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index b925857..660c12f 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -554,6 +554,9 @@ void MainController::handleNotificationClicked(const JID& jid) {
void MainController::handleQuitRequest() {
if (client_ && client_->isActive()) {
quitRequested_ = true;
+ quitTimer_ = networkFactories_->getTimerFactory()->createTimer(SecondsToWaitBeforeForceQuitting * 1000);
+ quitTimer_->onTick.connect(boost::bind(&MainController::handleForceQuit, this));
+ quitTimer_->start();
client_->disconnect();
}
else {
@@ -562,4 +565,12 @@ void MainController::handleQuitRequest() {
}
}
+void MainController::handleForceQuit() {
+ delete client_;
+ client_ = NULL;
+ handleQuitRequest();
+}
+
+const int MainController::SecondsToWaitBeforeForceQuitting = 20;
+
}