aboutsummaryrefslogtreecommitdiff
path: root/src/DBusAPI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/DBusAPI.cpp')
-rw-r--r--src/DBusAPI.cpp22
1 files changed, 19 insertions, 3 deletions
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");