@@ -1,5 +1,5 @@
2− * Copyright (C) 2016 Canonical, Ltd.
2+ * Copyright (C) 2017 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
5 * it under the terms of the GNU General Public License as published by
@@ -17,6 +17,7 @@
17#include "URLDispatcher.h"
17#include "URLDispatcher.h"
19#include <QDBusConnection>
19#include <QDBusConnection>
21class URLDispatcherInterface : public QObject
22class URLDispatcherInterface : public QObject
@@ -63,7 +64,9 @@ void URLDispatcher::setActive(bool value)
63 connection.registerObject(QStringLiteral("/com/canonical/URLDispatcher"),
64 connection.registerObject(QStringLiteral("/com/canonical/URLDispatcher"),
64 dispatcher,
65 dispatcher,
65 QDBusConnection::ExportScriptableContents);
66 QDBusConnection::ExportScriptableContents);
66− connection.registerService(QStringLiteral("com.canonical.URLDispatcher"));
67+ if (!connection.registerService(QStringLiteral("com.canonical.URLDispatcher"))) {
68+ qWarning() << "Unable to register DBus service com.canonical.URLDispatcher";
67 m_dispatcher = dispatcher;
70 m_dispatcher = dispatcher;
69 connection.unregisterService(QStringLiteral("com.canonical.URLDispatcher"));
72 connection.unregisterService(QStringLiteral("com.canonical.URLDispatcher"));