on xenial help sign in
Ensure that on DBus both Unity and Launcher are uppercase
030b5bdTed Gould
plugins/Unity/Launcher/backend/launcherbackend.cpp+11−11
@@ -50,9 +50,9 @@ LauncherBackend::LauncherBackend(QObject *parent):
50
50
51 /* Set up ourselves on DBus */
51 /* Set up ourselves on DBus */
52 QDBusConnection con = QDBusConnection::sessionBus();
52 QDBusConnection con = QDBusConnection::sessionBus();
53− if (!con.registerService("com.canonical.unity.launcher"))
53+ if (!con.registerService("com.canonical.Unity.Launcher"))
54 qDebug() << "Unable to register launcher name";
54 qDebug() << "Unable to register launcher name";
55− if (!con.registerVirtualObject("/com/canonical/unity/launcher", this, QDBusConnection::VirtualObjectRegisterOption::SubPath))
55+ if (!con.registerVirtualObject("/com/canonical/Unity/Launcher", this, QDBusConnection::VirtualObjectRegisterOption::SubPath))
56 qDebug() << "Unable to register launcher object";
56 qDebug() << "Unable to register launcher object";
57}
57}
58
58
@@ -60,8 +60,8 @@ LauncherBackend::~LauncherBackend()
60{
60{
61 /* Remove oursevles from DBus */
61 /* Remove oursevles from DBus */
62 QDBusConnection con = QDBusConnection::sessionBus();
62 QDBusConnection con = QDBusConnection::sessionBus();
63− con.unregisterService("com.canonical.unity.launcher");
63+ con.unregisterService("com.canonical.Unity.Launcher");
64− con.unregisterObject("/com/canonical/unity/launcher");
64+ con.unregisterObject("/com/canonical/Unity/Launcher");
65
65
66 /* Clear data */
66 /* Clear data */
67 m_storedApps.clear();
67 m_storedApps.clear();
@@ -427,14 +427,14 @@ bool LauncherBackend::handleMessage(const QDBusMessage& message, const QDBusConn
427 return false;
427 return false;
428 if (message.interface() != "org.freedesktop.DBus.Properties")
428 if (message.interface() != "org.freedesktop.DBus.Properties")
429 return false;
429 return false;
430− if (message.arguments()[0].toString() != "com.canonical.unity.Launcher.Item")
430+ if (message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item")
431 return false;
431 return false;
432
432
433 /* Break down the path to just the app id */
433 /* Break down the path to just the app id */
434 QString pathtemp = message.path();
434 QString pathtemp = message.path();
435− if (!pathtemp.startsWith("/com/canonical/unity/launcher/"))
435+ if (!pathtemp.startsWith("/com/canonical/Unity/Launcher/"))
436 return false;
436 return false;
437− pathtemp.remove("/com/canonical/unity/launcher/");
437+ pathtemp.remove("/com/canonical/Unity/Launcher/");
438 if (pathtemp.indexOf('/') >= 0)
438 if (pathtemp.indexOf('/') >= 0)
439 return false;
439 return false;
440
440
@@ -465,7 +465,7 @@ bool LauncherBackend::handleMessage(const QDBusMessage& message, const QDBusConn
465QString LauncherBackend::introspect (const QString &path) const
465QString LauncherBackend::introspect (const QString &path) const
466{
466{
467 /* This case we should just list the nodes */
467 /* This case we should just list the nodes */
468− if (path == "/com/canonical/unity/launcher/" || path == "/com/canonical/unity/launcher") {
468+ if (path == "/com/canonical/Unity/Launcher/" || path == "/com/canonical/Unity/Launcher") {
469 QString nodes;
469 QString nodes;
470
470
471 Q_FOREACH(const QString &appId, m_itemCache.keys()) {
471 Q_FOREACH(const QString &appId, m_itemCache.keys()) {
@@ -478,13 +478,13 @@ QString LauncherBackend::introspect (const QString &path) const
478 }
478 }
479
479
480 /* Should not happen, but let's handle it */
480 /* Should not happen, but let's handle it */
481− if (!path.startsWith("/com/canonical/unity/launcher")) {
481+ if (!path.startsWith("/com/canonical/Unity/Launcher")) {
482 return "";
482 return "";
483 }
483 }
484
484
485 /* Now we should be looking at a node */
485 /* Now we should be looking at a node */
486 QString nodeiface =
486 QString nodeiface =
487− "<interface name=\"com.canonical.unity.Launcher.Item\">"
487+ "<interface name=\"com.canonical.Unity.Launcher.Item\">"
488 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
488 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
489 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
489 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
490 "</interface>";
490 "</interface>";
@@ -541,7 +541,7 @@ QString LauncherBackend::encodeAppId (const QString& appId)
541
541
542void LauncherBackend::emitPropChangedDbus (const QString& appId, const QString& property, QVariant &value) const
542void LauncherBackend::emitPropChangedDbus (const QString& appId, const QString& property, QVariant &value) const
543{
543{
544− QString path("/com/canonical/unity/launcher/");
544+ QString path("/com/canonical/Unity/Launcher/");
545 path.append(encodeAppId(appId));
545 path.append(encodeAppId(appId));
546
546
547 QDBusMessage message = QDBusMessage::createSignal(path, "org.freedesktop.DBus.Properties", "PropertiesChanged");
547 QDBusMessage message = QDBusMessage::createSignal(path, "org.freedesktop.DBus.Properties", "PropertiesChanged");
tests/plugins/Unity/Launcher/launcherbackendtest.cpp+9−9
@@ -169,12 +169,12 @@ private Q_SLOTS:
169 LauncherBackend backend;
169 LauncherBackend backend;
170
170
171 if (setCount) {
171 if (setCount) {
172− message = QDBusMessage::createMethodCall("com.canonical.unity.launcher",
172+ message = QDBusMessage::createMethodCall("com.canonical.Unity.Launcher",
173− "/com/canonical/unity/launcher/" + LauncherBackend::encodeAppId(appId),
173+ "/com/canonical/Unity/Launcher/" + LauncherBackend::encodeAppId(appId),
174 "org.freedesktop.DBus.Properties",
174 "org.freedesktop.DBus.Properties",
175 "Set");
175 "Set");
176 QVariantList cargs;
176 QVariantList cargs;
177− cargs.append(QString("com.canonical.unity.Launcher.Item"));
177+ cargs.append(QString("com.canonical.Unity.Launcher.Item"));
178 cargs.append(QString("count"));
178 cargs.append(QString("count"));
179 cargs.append(QVariant::fromValue(QDBusVariant(inCount)));
179 cargs.append(QVariant::fromValue(QDBusVariant(inCount)));
180
180
@@ -184,12 +184,12 @@ private Q_SLOTS:
184 }
184 }
185
185
186 /* Set countVisible */
186 /* Set countVisible */
187− message = QDBusMessage::createMethodCall("com.canonical.unity.launcher",
187+ message = QDBusMessage::createMethodCall("com.canonical.Unity.Launcher",
188− "/com/canonical/unity/launcher/" + LauncherBackend::encodeAppId(appId),
188+ "/com/canonical/Unity/Launcher/" + LauncherBackend::encodeAppId(appId),
189 "org.freedesktop.DBus.Properties",
189 "org.freedesktop.DBus.Properties",
190 "Set");
190 "Set");
191 QVariantList cvargs;
191 QVariantList cvargs;
192− cvargs.append(QString("com.canonical.unity.Launcher.Item"));
192+ cvargs.append(QString("com.canonical.Unity.Launcher.Item"));
193 cvargs.append(QString("countVisible"));
193 cvargs.append(QString("countVisible"));
194 cvargs.append(QVariant::fromValue(QDBusVariant(countVisible)));
194 cvargs.append(QVariant::fromValue(QDBusVariant(countVisible)));
195
195
@@ -198,12 +198,12 @@ private Q_SLOTS:
198 QCOMPARE(reply.type(), QDBusMessage::ReplyMessage);
198 QCOMPARE(reply.type(), QDBusMessage::ReplyMessage);
199
199
200 /* Get value */
200 /* Get value */
201− message = QDBusMessage::createMethodCall("com.canonical.unity.launcher",
201+ message = QDBusMessage::createMethodCall("com.canonical.Unity.Launcher",
202− "/com/canonical/unity/launcher/" + LauncherBackend::encodeAppId(appId),
202+ "/com/canonical/Unity/Launcher/" + LauncherBackend::encodeAppId(appId),
203 "org.freedesktop.DBus.Properties",
203 "org.freedesktop.DBus.Properties",
204 "Get");
204 "Get");
205 QVariantList getargs;
205 QVariantList getargs;
206− getargs.append(QString("com.canonical.unity.Launcher.Item"));
206+ getargs.append(QString("com.canonical.Unity.Launcher.Item"));
207 getargs.append(QString("count"));
207 getargs.append(QString("count"));
208
208
209 message.setArguments(getargs);
209 message.setArguments(getargs);