aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2020-07-29 17:44:31 +0200
committerDaniel Teichmann <daniel.teichmann@das-netzwerkteam.de>2020-07-29 17:44:31 +0200
commit4168bcb67de27e85ebbffc4f9f3ef3fdbdc3fd8e (patch)
tree7307318b338e40f05a919dafd402d85752041a20
parent9c550c88426713193671e7e38ff013a9a072776f (diff)
downloadRWA.Support.DesktopApp-4168bcb67de27e85ebbffc4f9f3ef3fdbdc3fd8e.tar.gz
RWA.Support.DesktopApp-4168bcb67de27e85ebbffc4f9f3ef3fdbdc3fd8e.tar.bz2
RWA.Support.DesktopApp-4168bcb67de27e85ebbffc4f9f3ef3fdbdc3fd8e.zip
No status refresh request when session is not running or active
-rw-r--r--src/session.cpp13
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() {