on xenial help sign in
And unregister the url-dispatcher well-known dbus name if we are set inactive (shouldn't happen in real practice)
commite483a3cc04a99f2c5f3a1454f40c96326cb8ee88 authorMichael Terry <michael.terry@canonical.com> dateFri 15 Jul 2016, 14:18 (10 years ago) parentc2192a3
1 file changed+3−1
plugins/Utils/URLDispatcher.cpp+3−1
plugins/Utils/URLDispatcher.cpp+3−1
@@ -56,8 +56,9 @@ void URLDispatcher::setActive(bool value)
5656 if (value == active())
5757 return;
5858
59+ QDBusConnection connection = QDBusConnection::sessionBus();
60+
5961 if (value) {
60− QDBusConnection connection = QDBusConnection::sessionBus();
6162 URLDispatcherInterface *dispatcher = new URLDispatcherInterface(this);
6263 connection.registerObject(QStringLiteral("/com/canonical/URLDispatcher"),
6364 dispatcher,
@@ -65,6 +66,7 @@ void URLDispatcher::setActive(bool value)
6566 connection.registerService(QStringLiteral("com.canonical.URLDispatcher"));
6667 m_dispatcher = dispatcher;
6768 } else {
69+ connection.unregisterService(QStringLiteral("com.canonical.URLDispatcher"));
6870 delete m_dispatcher;
6971 m_dispatcher = nullptr;
7072 }