From 6bea345ecf8a6cc451b2a7434b8294acacfbe0b4 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Thu, 8 Jul 2021 16:42:51 +0200 Subject: At QDBusError: Give the user a hint that the session service is not started. --- src/DBusAPI.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/DBusAPI.cpp b/src/DBusAPI.cpp index 18c5974..760935b 100644 --- a/src/DBusAPI.cpp +++ b/src/DBusAPI.cpp @@ -82,7 +82,12 @@ void DBusAPI::start_reply(QDBusPendingCallWatcher *call) { qCritical() << "D-Bus 'start' request failed, this was the reply:"; qCritical() << reply.error(); + if (QDBusError::ServiceUnknown == reply.error().type()) { + qCritical() << "The session service was probably just not started!"; + } + emit serviceStartResponse(nullptr); + return; } else { result = reply.argumentAt<0>(); @@ -143,7 +148,13 @@ void DBusAPI::stop_reply(QDBusPendingCallWatcher *call) { qCritical() << "D-Bus 'stop' request failed, this was the reply:"; qCritical() << reply.error(); + if (QDBusError::ServiceUnknown == reply.error().type()) { + qCritical() << "The session service was probably just not started!"; + } + emit serviceStopResponse(nullptr); + + return; } else { result = reply.argumentAt<0>(); } @@ -232,7 +243,12 @@ void DBusAPI::status_reply(QDBusPendingCallWatcher *call){ qCritical() << "D-Bus '(refresh_)status' request failed, this was the reply:"; qCritical() << reply.error(); + if (QDBusError::ServiceUnknown == reply.error().type()) { + qCritical() << "The session service was probably just not started!"; + } + emit serviceStatusResponse(nullptr); + return; } else { result = reply.argumentAt<0>(); @@ -319,7 +335,12 @@ void DBusAPI::get_web_app_hosts_reply(QDBusPendingCallWatcher *call){ qCritical() << "D-Bus 'get_web_app_hosts' request failed, this was the reply:"; qCritical() << reply.error(); + if (QDBusError::ServiceUnknown == reply.error().type()) { + qCritical() << "The session service was probably just not started!"; + } + emit serviceGetWebAppHostsResponse(nullptr); + return; } else { result = reply.argumentAt<0>(); @@ -348,7 +369,12 @@ void DBusAPI::add_web_app_host_reply(QDBusPendingCallWatcher *call){ qCritical() << "D-Bus 'add_web_app_host' request failed, this was the reply:"; qCritical() << reply.error(); + if (QDBusError::ServiceUnknown == reply.error().type()) { + qCritical() << "The session service was probably just not started!"; + } + emit serviceAddWebAppHostResponse(nullptr); + return; } else { result = reply.argumentAt<0>(); @@ -377,7 +403,12 @@ void DBusAPI::remove_web_app_host_reply(QDBusPendingCallWatcher *call){ qCritical() << "D-Bus 'remove_web_app_host' request failed, this was the reply:"; qCritical() << reply.error(); + if (QDBusError::ServiceUnknown == reply.error().type()) { + qCritical() << "The session service was probably just not started!"; + } + emit serviceRemoveWebAppHostResponse(nullptr); + return; } else { result = reply.argumentAt<0>(); -- cgit v1.2.3