From f18e74917bd24101ca3ac7fbd20f52431693488a Mon Sep 17 00:00:00 2001 From: arcan1s Date: Wed, 27 Aug 2014 18:14:22 +0400 Subject: [PATCH] more correct checking dbus response --- sources/gui/src/main.cpp | 2 +- sources/gui/src/mainwindow.cpp | 2 +- sources/helper/src/main.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/gui/src/main.cpp b/sources/gui/src/main.cpp index 40ce105..923032b 100644 --- a/sources/gui/src/main.cpp +++ b/sources/gui/src/main.cpp @@ -43,7 +43,7 @@ bool existingSessionOperation(const QString operation) QDBusMessage response = bus.call(request); QList arguments = response.arguments(); - return !arguments.isEmpty(); + return (!arguments.isEmpty() && bool(arguments[0].toInt())); } diff --git a/sources/gui/src/mainwindow.cpp b/sources/gui/src/mainwindow.cpp index 39ca781..e773397 100644 --- a/sources/gui/src/mainwindow.cpp +++ b/sources/gui/src/mainwindow.cpp @@ -234,7 +234,7 @@ bool MainWindow::isHelperActive() DBUS_HELPER_INTERFACE, QString("Active"), QList(), true, debug); - return (!responce.isEmpty()); + return (!responce.isEmpty() && bool(responce[0].toInt())); } diff --git a/sources/helper/src/main.cpp b/sources/helper/src/main.cpp index 861b518..a0ec8d4 100644 --- a/sources/helper/src/main.cpp +++ b/sources/helper/src/main.cpp @@ -43,7 +43,7 @@ bool existingSessionOperation(const QString operation) QDBusMessage response = bus.call(request); QList arguments = response.arguments(); - return !arguments.isEmpty(); + return (!arguments.isEmpty() && bool(arguments[0].toInt())); }