diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/session.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/session.cpp b/src/session.cpp index f10c3dc..55360ef 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -67,6 +67,14 @@ QString Session::getPin() { return _pin; } +bool Session::isSessionAliveOrRunning(QString status) { + if (status.length() > 0 && (status == "running" || status == "active")) { + return true; + } else { + return false; + } +} + void Session::setStatus(QString status) { _status = status; @@ -332,6 +340,11 @@ void Session::status_dbus_replied(QDBusPendingCallWatcher *call) { // Enable (dis)connect button _main_gui->setConnectButtonEnabled(true); + + if (this->isSessionAliveOrRunning(new_status)) { + // Ask status every 1000 millisecond + QTimer::singleShot(1000, this, &Session::statusTimerEvent); + } } void Session::onCloseHandler() { |