on xenial help sign in
Add warning if registerService fails

Coverity argues we do that in the rest of calls so be consistent

commit49437dc7a8012bccf2db153820dfffc71632adaf authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 1 Mar 2017, 17:08 (10 years ago) parent71b62b7
1 file changed+5−2
plugins/Utils/URLDispatcher.cpp+5−2
plugins/Utils/URLDispatcher.cpp+5−2
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2016 Canonical, Ltd.
2+ * Copyright (C) 2017 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -17,6 +17,7 @@
1717#include "URLDispatcher.h"
1818
1919#include <QDBusConnection>
20+#include <QDebug>
2021
2122class URLDispatcherInterface : public QObject
2223{
@@ -63,7 +64,9 @@ void URLDispatcher::setActive(bool value)
6364 connection.registerObject(QStringLiteral("/com/canonical/URLDispatcher"),
6465 dispatcher,
6566 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";
69+ }
6770 m_dispatcher = dispatcher;
6871 } else {
6972 connection.unregisterService(QStringLiteral("com.canonical.URLDispatcher"));