From 11787ea278bc6ff6d5bc797b597df3f26e2ec9b4 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Tue, 6 Jul 2021 19:55:13 +0200 Subject: Introduce DBusAPI and RWAHost classes --- src/DBusAPI.cpp | 351 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 351 insertions(+) create mode 100644 src/DBusAPI.cpp (limited to 'src/DBusAPI.cpp') diff --git a/src/DBusAPI.cpp b/src/DBusAPI.cpp new file mode 100644 index 0000000..0809a51 --- /dev/null +++ b/src/DBusAPI.cpp @@ -0,0 +1,351 @@ +#include "DBusAPI.h" + +/*! + * \class DBusAPI + * \brief The DBusAPI class provides all necessary D-Bus methods and distributes the response via signals. + */ +DBusAPI::DBusAPI() { + _initDBus(); +} + +/*! + * \brief Initializes private _dbus_rwa object. + */ +void DBusAPI::_initDBus() { + if (!QDBusConnection::sessionBus().isConnected()) { + qCritical() << "Cannot connect to the D-Bus session bus."; + } + + // Create DBus object + _dbus_rwa = new OrgArcticaProjectRWASupportSessionServiceInterface("org.ArcticaProject.RWASupportSessionService", + "/RWASupportSessionService", + QDBusConnection::sessionBus(), + this->parent()); + + qDebug("Initialized DBus object!"); +} + +/*! + * \brief Ask the session service to start a session. + * + * \a host RWAHost object which includes all necessary information about a RWA host. + */ +void DBusAPI::start_request(RWAHost *host) { + qDebug() << "Requesting D-Bus service to start a new session on host:" << host->alias(); + + // Make an asynchrous 'start' call (Response will be sent to 'start_reply') + QDBusPendingCall async = _dbus_rwa->asyncCall("start", host->uuid()); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); + + QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), + this, SLOT(start_reply(QDBusPendingCallWatcher*))); +} + +/*! + * \brief Method gets called when a D-Bus response is ready. + * + * \a call contains the D-Bus response (session service or for example maybe just a error message). + * + * TODO: Example of json input + */ +void DBusAPI::start_reply(QDBusPendingCallWatcher *call) { + QString result = ""; + QDBusPendingReply reply = *call; + if (reply.isError()) { + qDebug() << "D-Bus 'start' request failed, this was the reply:"; + qDebug() << reply.error(); + + emit serviceStartResponse(nullptr); + return; + } else { + result = reply.argumentAt<0>(); + } + call->deleteLater(); + + qDebug() << "Raw JSON from starting session is:" << result.toUtf8().replace('"', ""); + QJsonDocument doc = QJsonDocument::fromJson(result.toUtf8()); + + emit serviceStartResponse(&doc); +} + +/*! + * \brief Ask the session service to stop session #. + * + * \a host RWAHost object which includes all necessary information about a RWA host. + * + * \a session_id Unique identifier for a session in a specific host. + */ +void DBusAPI::stop_request(RWAHost *host, QString session_id) { + bool ok; + long long session_id_number = session_id.toLongLong(&ok); + + // Sanity Check + if(ok == false){ + qWarning() << QString("Unable to parse '%0' as long long!").arg(session_id); + return; + } + + qDebug().noquote() << QString("Requesting D-Bus service to stop " + "session #'%0' on host '%1'") + .arg(session_id) + .arg(host->alias()); + + // Make an asynchrous 'start' call (Response will be sent to 'stop_reply') + QDBusPendingCall async = _dbus_rwa->asyncCall("stop", host->uuid(), session_id_number); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); + + QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), + this, SLOT(stop_reply(QDBusPendingCallWatcher*))); +} + +/*! + * \brief Method gets called when a D-Bus response is ready. + * + * \a call contains the D-Bus response (session service or for example maybe just a error message). + * + * TODO: Example of json input + */ +void DBusAPI::stop_reply(QDBusPendingCallWatcher *call) { + QString result = ""; + + QDBusPendingReply reply = *call; + if (reply.isError()) { + qDebug() << "D-Bus 'stop' request failed, this was the reply:"; + qDebug() << reply.error(); + + emit serviceStopResponse(nullptr); + } else { + result = reply.argumentAt<0>(); + } + call->deleteLater(); + + qDebug() << "Raw JSON from stopping a session is:" << result.toUtf8().replace('"', ""); + QJsonDocument doc = QJsonDocument::fromJson(result.toUtf8()); + + emit serviceStopResponse(&doc); +} + +/*! + * \brief Ask the session service for status of . + * + * \a host RWAHost object which includes all necessary information about a RWA host. + * + * \a session_id Unique identifier for a session in a specific host. + */ +void DBusAPI::status_request(RWAHost *host, QString session_id) { + bool ok; + long long session_id_number = session_id.toLongLong(&ok); + + // Sanity Check + if(ok == false){ + qWarning() << QString("Unable to parse '%0' as long long!").arg(session_id); + return; + } + + qDebug().noquote() << QString("Requesting D-Bus service for status of session " + "#'%0' on host '%1'").arg(session_id).arg(host->alias()); + + // Make an asynchrous 'start' call (Response will be sent to 'status_reply') + QDBusPendingCall async = _dbus_rwa->asyncCall("status", host->uuid(), session_id_number); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); + + QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), + this, SLOT(status_reply(QDBusPendingCallWatcher*))); +} + +/*! + * \brief Forces the session service to refresh it's status of and tell us about it then. + * + * \a host RWAHost object which includes all necessary information about a RWA host. + * + * \a session_id Unique identifier for a session in a specific host. + */ +void DBusAPI::refresh_status_request(RWAHost *host, QString session_id) { + bool ok; + long long session_id_number = session_id.toLongLong(&ok); + + // Sanity Check + if(ok == false){ + qWarning() << QString("Unable to parse '%0' as long long!").arg(session_id); + return; + } + + qDebug().noquote() << QString("Requesting D-Bus service for refresh_status of session " + "#'%0' on host '%1'").arg(session_id).arg(host->alias()); + + // Make an asynchrous 'start' call (Response will be sent to 'status_reply') + QDBusPendingCall async = _dbus_rwa->asyncCall("refresh_status", host->uuid(), session_id_number); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); + + QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), + this, SLOT(status_reply(QDBusPendingCallWatcher*))); +} + +/*! + * \brief Method gets called when a D-Bus response is ready. + * + * \a call contains the D-Bus response (session service or for example maybe just a error message). + * + * TODO: Example of json input + */ +void DBusAPI::status_reply(QDBusPendingCallWatcher *call){ + QString result = ""; + + QDBusPendingReply reply = *call; + if (reply.isError()) { + qDebug() << "D-Bus '(refresh_)status' request failed, this was the reply:"; + qDebug() << reply.error(); + + emit serviceStatusResponse(nullptr); + return; + } else { + result = reply.argumentAt<0>(); + } + call->deleteLater(); + + // Get the QJsonObject + qDebug() << "Raw JSON from a status request for a session is:" << result.toUtf8().replace('"', ""); + QJsonDocument doc = QJsonDocument::fromJson(result.toUtf8()); + + emit serviceStatusResponse(&doc); +} + +/*! + * \brief This method requests the session service to list all RWAHosts. + */ +void DBusAPI::get_web_app_hosts_request() { + qDebug().noquote() << QString("Requesting D-Bus service to list " + "all remote web app hosts"); + + // Make an asynchrous 'get_web_app_hosts' call + // Response will be sent to 'get_web_app_hosts_reply' + QDBusPendingCall async = _dbus_rwa->asyncCall("get_web_app_hosts"); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); + + QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), + this, SLOT(get_web_app_hosts_reply(QDBusPendingCallWatcher*))); +} + +/*! + * \brief This method requests the session service to add a RWAHost to its configuration files. + * + * \a host_url is the remote web app adress which will be used by the session service to coordinate + * sessions, connections, settings and such. + */ +void DBusAPI::add_web_app_host_request(QString host_url) { + qDebug().noquote() << QString("Requesting D-Bus service to register new " + "remote web app host with url '%0'").arg(host_url); + + // Make an asynchrous 'add_web_app_host' call + // Response will be sent to 'add_web_app_host_reply' + QDBusPendingCall async = _dbus_rwa->asyncCall("add_web_app_host", host_url); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); + + QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), + this, SLOT(add_web_app_host_reply(QDBusPendingCallWatcher*))); +} + +/*! + * \brief This method requests the session service to remove a RWAHost from its configuration files. + * + * \a host_uuid Unique identifier which all hosts have. + */ +void DBusAPI::remove_web_app_host_request(QString host_uuid) { + qDebug().noquote() << QString("Requesting D-Bus service to list " + "all remote web app hosts"); + + // Make an asynchrous 'remove_web_app_host' call + // Response will be sent to 'remove_web_app_host_reply' + QDBusPendingCall async = _dbus_rwa->asyncCall("remove_web_app_host", host_uuid); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); + + QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), + this, SLOT(remove_web_app_host_reply(QDBusPendingCallWatcher*))); +} + +/*! + * \brief Method gets called when a D-Bus response is ready. + * + * \a call contains the D-Bus response (session service or for example maybe just a error message). + * + * TODO: Example of json input + */ +void DBusAPI::get_web_app_hosts_reply(QDBusPendingCallWatcher *call){ + QString result = ""; + + QDBusPendingReply reply = *call; + if (reply.isError()) { + qDebug() << "D-Bus 'get_web_app_hosts' request failed, this was the reply:"; + qDebug() << reply.error(); + + emit serviceGetWebAppHostsResponse(nullptr); + return; + } else { + result = reply.argumentAt<0>(); + } + call->deleteLater(); + + // Get the QJsonObject + qDebug() << "Raw JSON from the remote web app host listing request:" << result.toUtf8().replace('"', ""); + QJsonDocument doc = QJsonDocument::fromJson(result.toUtf8()); + + emit serviceGetWebAppHostsResponse(&doc); +} + +/*! + * \brief Method gets called when a D-Bus response is ready. + * + * \a call contains the D-Bus response (session service or for example maybe just a error message). + * + * TODO: Example of json input + */ +void DBusAPI::add_web_app_host_reply(QDBusPendingCallWatcher *call){ + QString result = ""; + + QDBusPendingReply reply = *call; + if (reply.isError()) { + qDebug() << "D-Bus 'add_web_app_host' request failed, this was the reply:"; + qDebug() << reply.error(); + + emit serviceAddWebAppHostResponse(nullptr); + return; + } else { + result = reply.argumentAt<0>(); + } + call->deleteLater(); + + // Get the QJsonObject + qDebug() << "Raw JSON from the remote web app host register request:" << result.toUtf8().replace('"', ""); + QJsonDocument doc = QJsonDocument::fromJson(result.toUtf8()); + + emit serviceAddWebAppHostResponse(&doc); +} + +/*! + * \brief Method gets called when a D-Bus response is ready. + * + * \a call contains the D-Bus response (session service or for example maybe just a error message). + * + * TODO: Example of json input + */ +void DBusAPI::remove_web_app_host_reply(QDBusPendingCallWatcher *call){ + QString result = ""; + + QDBusPendingReply reply = *call; + if (reply.isError()) { + qDebug() << "D-Bus 'remove_web_app_host' request failed, this was the reply:"; + qDebug() << reply.error(); + + emit serviceRemoveWebAppHostResponse(nullptr); + return; + } else { + result = reply.argumentAt<0>(); + } + call->deleteLater(); + + // Get the QJsonObject + qDebug() << "Raw JSON from the remote web app host deletion request:" << result.toUtf8().replace('"', ""); + QJsonDocument doc = QJsonDocument::fromJson(result.toUtf8()); + + emit serviceRemoveWebAppHostResponse(&doc); +} -- cgit v1.2.3 From 98049d1507a6f2ae232782fd79f4f753ad53eead Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Tue, 6 Jul 2021 20:02:31 +0200 Subject: Fix copyright headers --- src/DBusAPI.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/DBusAPI.cpp') diff --git a/src/DBusAPI.cpp b/src/DBusAPI.cpp index 0809a51..c133910 100644 --- a/src/DBusAPI.cpp +++ b/src/DBusAPI.cpp @@ -1,3 +1,28 @@ +/* + * This file is part of Remote Support Desktop + * https://gitlab.das-netzwerkteam.de/RemoteWebApp/rwa.support.desktopapp + * Copyright 2021 Daniel Teichmann + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include "DBusAPI.h" /*! -- cgit v1.2.3 From 3b2c865566aea43ab21afadcd34f58db0a5d5ab8 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Tue, 6 Jul 2021 20:25:45 +0200 Subject: DBusAPI: Change critical error to qCritical instead of qDebug. --- src/DBusAPI.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/DBusAPI.cpp') diff --git a/src/DBusAPI.cpp b/src/DBusAPI.cpp index c133910..7f14e4f 100644 --- a/src/DBusAPI.cpp +++ b/src/DBusAPI.cpp @@ -77,8 +77,8 @@ void DBusAPI::start_reply(QDBusPendingCallWatcher *call) { QString result = ""; QDBusPendingReply reply = *call; if (reply.isError()) { - qDebug() << "D-Bus 'start' request failed, this was the reply:"; - qDebug() << reply.error(); + qCritical() << "D-Bus 'start' request failed, this was the reply:"; + qCritical() << reply.error(); emit serviceStartResponse(nullptr); return; @@ -135,8 +135,8 @@ void DBusAPI::stop_reply(QDBusPendingCallWatcher *call) { QDBusPendingReply reply = *call; if (reply.isError()) { - qDebug() << "D-Bus 'stop' request failed, this was the reply:"; - qDebug() << reply.error(); + qCritical() << "D-Bus 'stop' request failed, this was the reply:"; + qCritical() << reply.error(); emit serviceStopResponse(nullptr); } else { @@ -218,8 +218,8 @@ void DBusAPI::status_reply(QDBusPendingCallWatcher *call){ QDBusPendingReply reply = *call; if (reply.isError()) { - qDebug() << "D-Bus '(refresh_)status' request failed, this was the reply:"; - qDebug() << reply.error(); + qCritical() << "D-Bus '(refresh_)status' request failed, this was the reply:"; + qCritical() << reply.error(); emit serviceStatusResponse(nullptr); return; @@ -300,8 +300,8 @@ void DBusAPI::get_web_app_hosts_reply(QDBusPendingCallWatcher *call){ QDBusPendingReply reply = *call; if (reply.isError()) { - qDebug() << "D-Bus 'get_web_app_hosts' request failed, this was the reply:"; - qDebug() << reply.error(); + qCritical() << "D-Bus 'get_web_app_hosts' request failed, this was the reply:"; + qCritical() << reply.error(); emit serviceGetWebAppHostsResponse(nullptr); return; @@ -329,8 +329,8 @@ void DBusAPI::add_web_app_host_reply(QDBusPendingCallWatcher *call){ QDBusPendingReply reply = *call; if (reply.isError()) { - qDebug() << "D-Bus 'add_web_app_host' request failed, this was the reply:"; - qDebug() << reply.error(); + qCritical() << "D-Bus 'add_web_app_host' request failed, this was the reply:"; + qCritical() << reply.error(); emit serviceAddWebAppHostResponse(nullptr); return; @@ -358,8 +358,8 @@ void DBusAPI::remove_web_app_host_reply(QDBusPendingCallWatcher *call){ QDBusPendingReply reply = *call; if (reply.isError()) { - qDebug() << "D-Bus 'remove_web_app_host' request failed, this was the reply:"; - qDebug() << reply.error(); + qCritical() << "D-Bus 'remove_web_app_host' request failed, this was the reply:"; + qCritical() << reply.error(); emit serviceRemoveWebAppHostResponse(nullptr); return; -- cgit v1.2.3 From 0f73c7ff3f8a84bcacf077644d6a199301f58945 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Thu, 8 Jul 2021 15:54:20 +0200 Subject: User can decide on host_alias now. --- src/DBusAPI.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/DBusAPI.cpp') diff --git a/src/DBusAPI.cpp b/src/DBusAPI.cpp index 7f14e4f..18c5974 100644 --- a/src/DBusAPI.cpp +++ b/src/DBusAPI.cpp @@ -56,6 +56,8 @@ void DBusAPI::_initDBus() { * \a host RWAHost object which includes all necessary information about a RWA host. */ void DBusAPI::start_request(RWAHost *host) { + Q_ASSERT(host != nullptr); + qDebug() << "Requesting D-Bus service to start a new session on host:" << host->alias(); // Make an asynchrous 'start' call (Response will be sent to 'start_reply') @@ -101,6 +103,9 @@ void DBusAPI::start_reply(QDBusPendingCallWatcher *call) { * \a session_id Unique identifier for a session in a specific host. */ void DBusAPI::stop_request(RWAHost *host, QString session_id) { + Q_ASSERT(host != nullptr); + Q_ASSERT(session_id != ""); + bool ok; long long session_id_number = session_id.toLongLong(&ok); @@ -158,6 +163,9 @@ void DBusAPI::stop_reply(QDBusPendingCallWatcher *call) { * \a session_id Unique identifier for a session in a specific host. */ void DBusAPI::status_request(RWAHost *host, QString session_id) { + Q_ASSERT(host != nullptr); + Q_ASSERT(session_id != ""); + bool ok; long long session_id_number = session_id.toLongLong(&ok); @@ -186,6 +194,9 @@ void DBusAPI::status_request(RWAHost *host, QString session_id) { * \a session_id Unique identifier for a session in a specific host. */ void DBusAPI::refresh_status_request(RWAHost *host, QString session_id) { + Q_ASSERT(host != nullptr); + Q_ASSERT(session_id != ""); + bool ok; long long session_id_number = session_id.toLongLong(&ok); @@ -257,13 +268,16 @@ void DBusAPI::get_web_app_hosts_request() { * \a host_url is the remote web app adress which will be used by the session service to coordinate * sessions, connections, settings and such. */ -void DBusAPI::add_web_app_host_request(QString host_url) { +void DBusAPI::add_web_app_host_request(QString host_url, QString host_alias) { + Q_ASSERT(host_url != ""); + Q_ASSERT(host_alias != ""); + qDebug().noquote() << QString("Requesting D-Bus service to register new " - "remote web app host with url '%0'").arg(host_url); + "remote web app host '%0' with url '%1'").arg(host_alias).arg(host_url); // Make an asynchrous 'add_web_app_host' call // Response will be sent to 'add_web_app_host_reply' - QDBusPendingCall async = _dbus_rwa->asyncCall("add_web_app_host", host_url); + QDBusPendingCall async = _dbus_rwa->asyncCall("add_web_app_host", host_url, host_alias); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), @@ -276,6 +290,8 @@ void DBusAPI::add_web_app_host_request(QString host_url) { * \a host_uuid Unique identifier which all hosts have. */ void DBusAPI::remove_web_app_host_request(QString host_uuid) { + Q_ASSERT(host_uuid != ""); + qDebug().noquote() << QString("Requesting D-Bus service to list " "all remote web app hosts"); -- cgit v1.2.3 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(+) (limited to 'src/DBusAPI.cpp') 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 From efa44c931674e498c39fc59091cf1f8654ac97a5 Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Sun, 1 Aug 2021 01:58:32 +0200 Subject: Fix typos, too long lines, various styling stuff --- src/DBusAPI.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/DBusAPI.cpp') diff --git a/src/DBusAPI.cpp b/src/DBusAPI.cpp index 760935b..83f38cb 100644 --- a/src/DBusAPI.cpp +++ b/src/DBusAPI.cpp @@ -60,7 +60,7 @@ void DBusAPI::start_request(RWAHost *host) { qDebug() << "Requesting D-Bus service to start a new session on host:" << host->alias(); - // Make an asynchrous 'start' call (Response will be sent to 'start_reply') + // Make an asynchronous 'start' call (Response will be sent to 'start_reply') QDBusPendingCall async = _dbus_rwa->asyncCall("start", host->uuid()); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); @@ -125,7 +125,7 @@ void DBusAPI::stop_request(RWAHost *host, QString session_id) { .arg(session_id) .arg(host->alias()); - // Make an asynchrous 'start' call (Response will be sent to 'stop_reply') + // Make an asynchronous 'stop' call (Response will be sent to 'stop_reply') QDBusPendingCall async = _dbus_rwa->asyncCall("stop", host->uuid(), session_id_number); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); @@ -182,14 +182,14 @@ void DBusAPI::status_request(RWAHost *host, QString session_id) { // Sanity Check if(ok == false){ - qWarning() << QString("Unable to parse '%0' as long long!").arg(session_id); + qWarning().noquote() << QString("Unable to parse session_id '%0' as long long!").arg(session_id); return; } qDebug().noquote() << QString("Requesting D-Bus service for status of session " "#'%0' on host '%1'").arg(session_id).arg(host->alias()); - // Make an asynchrous 'start' call (Response will be sent to 'status_reply') + // Make an asynchronous 'start' call (Response will be sent to 'status_reply') QDBusPendingCall async = _dbus_rwa->asyncCall("status", host->uuid(), session_id_number); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); @@ -213,14 +213,14 @@ void DBusAPI::refresh_status_request(RWAHost *host, QString session_id) { // Sanity Check if(ok == false){ - qWarning() << QString("Unable to parse '%0' as long long!").arg(session_id); + qWarning().noquote() << QString("Unable to parse session_id '%0' as long long!").arg(session_id); return; } qDebug().noquote() << QString("Requesting D-Bus service for refresh_status of session " "#'%0' on host '%1'").arg(session_id).arg(host->alias()); - // Make an asynchrous 'start' call (Response will be sent to 'status_reply') + // Make an asynchronous 'start' call (Response will be sent to 'status_reply') QDBusPendingCall async = _dbus_rwa->asyncCall("refresh_status", host->uuid(), session_id_number); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); @@ -269,7 +269,7 @@ void DBusAPI::get_web_app_hosts_request() { qDebug().noquote() << QString("Requesting D-Bus service to list " "all remote web app hosts"); - // Make an asynchrous 'get_web_app_hosts' call + // Make an asynchronous 'get_web_app_hosts' call // Response will be sent to 'get_web_app_hosts_reply' QDBusPendingCall async = _dbus_rwa->asyncCall("get_web_app_hosts"); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); @@ -291,7 +291,7 @@ void DBusAPI::add_web_app_host_request(QString host_url, QString host_alias) { qDebug().noquote() << QString("Requesting D-Bus service to register new " "remote web app host '%0' with url '%1'").arg(host_alias).arg(host_url); - // Make an asynchrous 'add_web_app_host' call + // Make an asynchronous 'add_web_app_host' call // Response will be sent to 'add_web_app_host_reply' QDBusPendingCall async = _dbus_rwa->asyncCall("add_web_app_host", host_url, host_alias); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); @@ -311,7 +311,7 @@ void DBusAPI::remove_web_app_host_request(QString host_uuid) { qDebug().noquote() << QString("Requesting D-Bus service to list " "all remote web app hosts"); - // Make an asynchrous 'remove_web_app_host' call + // Make an asynchronous 'remove_web_app_host' call // Response will be sent to 'remove_web_app_host_reply' QDBusPendingCall async = _dbus_rwa->asyncCall("remove_web_app_host", host_uuid); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); -- cgit v1.2.3 From 766a90125df68f065495354c20412faf9e1df77a Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Sun, 1 Aug 2021 02:19:15 +0200 Subject: move scenes/Scene_remote_control.qml into scenes/remote_control/Scene_remote_control.qml --- src/DBusAPI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/DBusAPI.cpp') diff --git a/src/DBusAPI.cpp b/src/DBusAPI.cpp index 83f38cb..9a0f8de 100644 --- a/src/DBusAPI.cpp +++ b/src/DBusAPI.cpp @@ -116,7 +116,7 @@ void DBusAPI::stop_request(RWAHost *host, QString session_id) { // Sanity Check if(ok == false){ - qWarning() << QString("Unable to parse '%0' as long long!").arg(session_id); + qWarning().noquote() << QString("Unable to parse session_id '%0' as long long!").arg(session_id); return; } -- cgit v1.2.3