on xenial help sign in
Ensure that on DBus both Unity and Launcher are uppercase
commit030b5bde888499da52a3abcc5d0436c49262b1b5 authorTed Gould <ted@gould.cx> dateTue 29 Apr 2014, 08:21 (12 years ago) parent690519c
2 files changed+20−20
plugins/Unity/Launcher/backend/launcherbackend.cpp+11−11 tests/plugins/Unity/Launcher/launcherbackendtest.cpp+9−9
plugins/Unity/Launcher/backend/launcherbackend.cpp+11−11
@@ -50,9 +50,9 @@ LauncherBackend::LauncherBackend(QObject *parent):
5050
5151 /* Set up ourselves on DBus */
5252 QDBusConnection con = QDBusConnection::sessionBus();
53− if (!con.registerService("com.canonical.unity.launcher"))
53+ if (!con.registerService("com.canonical.Unity.Launcher"))
5454 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))
5656 qDebug() << "Unable to register launcher object";
5757}
5858
@@ -60,8 +60,8 @@ LauncherBackend::~LauncherBackend()
6060{
6161 /* Remove oursevles from DBus */
6262 QDBusConnection con = QDBusConnection::sessionBus();
63− con.unregisterService("com.canonical.unity.launcher");
64− con.unregisterObject("/com/canonical/unity/launcher");
63+ con.unregisterService("com.canonical.Unity.Launcher");
64+ con.unregisterObject("/com/canonical/Unity/Launcher");
6565
6666 /* Clear data */
6767 m_storedApps.clear();
@@ -427,14 +427,14 @@ bool LauncherBackend::handleMessage(const QDBusMessage& message, const QDBusConn
427427 return false;
428428 if (message.interface() != "org.freedesktop.DBus.Properties")
429429 return false;
430− if (message.arguments()[0].toString() != "com.canonical.unity.Launcher.Item")
430+ if (message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item")
431431 return false;
432432
433433 /* Break down the path to just the app id */
434434 QString pathtemp = message.path();
435− if (!pathtemp.startsWith("/com/canonical/unity/launcher/"))
435+ if (!pathtemp.startsWith("/com/canonical/Unity/Launcher/"))
436436 return false;
437− pathtemp.remove("/com/canonical/unity/launcher/");
437+ pathtemp.remove("/com/canonical/Unity/Launcher/");
438438 if (pathtemp.indexOf('/') >= 0)
439439 return false;
440440
@@ -465,7 +465,7 @@ bool LauncherBackend::handleMessage(const QDBusMessage& message, const QDBusConn
465465QString LauncherBackend::introspect (const QString &path) const
466466{
467467 /* 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") {
469469 QString nodes;
470470
471471 Q_FOREACH(const QString &appId, m_itemCache.keys()) {
@@ -478,13 +478,13 @@ QString LauncherBackend::introspect (const QString &path) const
478478 }
479479
480480 /* Should not happen, but let's handle it */
481− if (!path.startsWith("/com/canonical/unity/launcher")) {
481+ if (!path.startsWith("/com/canonical/Unity/Launcher")) {
482482 return "";
483483 }
484484
485485 /* Now we should be looking at a node */
486486 QString nodeiface =
487− "<interface name=\"com.canonical.unity.Launcher.Item\">"
487+ "<interface name=\"com.canonical.Unity.Launcher.Item\">"
488488 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
489489 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
490490 "</interface>";
@@ -541,7 +541,7 @@ QString LauncherBackend::encodeAppId (const QString& appId)
541541
542542void LauncherBackend::emitPropChangedDbus (const QString& appId, const QString& property, QVariant &value) const
543543{
544− QString path("/com/canonical/unity/launcher/");
544+ QString path("/com/canonical/Unity/Launcher/");
545545 path.append(encodeAppId(appId));
546546
547547 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:
169169 LauncherBackend backend;
170170
171171 if (setCount) {
172− message = QDBusMessage::createMethodCall("com.canonical.unity.launcher",
173− "/com/canonical/unity/launcher/" + LauncherBackend::encodeAppId(appId),
172+ message = QDBusMessage::createMethodCall("com.canonical.Unity.Launcher",
173+ "/com/canonical/Unity/Launcher/" + LauncherBackend::encodeAppId(appId),
174174 "org.freedesktop.DBus.Properties",
175175 "Set");
176176 QVariantList cargs;
177− cargs.append(QString("com.canonical.unity.Launcher.Item"));
177+ cargs.append(QString("com.canonical.Unity.Launcher.Item"));
178178 cargs.append(QString("count"));
179179 cargs.append(QVariant::fromValue(QDBusVariant(inCount)));
180180
@@ -184,12 +184,12 @@ private Q_SLOTS:
184184 }
185185
186186 /* Set countVisible */
187− message = QDBusMessage::createMethodCall("com.canonical.unity.launcher",
188− "/com/canonical/unity/launcher/" + LauncherBackend::encodeAppId(appId),
187+ message = QDBusMessage::createMethodCall("com.canonical.Unity.Launcher",
188+ "/com/canonical/Unity/Launcher/" + LauncherBackend::encodeAppId(appId),
189189 "org.freedesktop.DBus.Properties",
190190 "Set");
191191 QVariantList cvargs;
192− cvargs.append(QString("com.canonical.unity.Launcher.Item"));
192+ cvargs.append(QString("com.canonical.Unity.Launcher.Item"));
193193 cvargs.append(QString("countVisible"));
194194 cvargs.append(QVariant::fromValue(QDBusVariant(countVisible)));
195195
@@ -198,12 +198,12 @@ private Q_SLOTS:
198198 QCOMPARE(reply.type(), QDBusMessage::ReplyMessage);
199199
200200 /* Get value */
201− message = QDBusMessage::createMethodCall("com.canonical.unity.launcher",
202− "/com/canonical/unity/launcher/" + LauncherBackend::encodeAppId(appId),
201+ message = QDBusMessage::createMethodCall("com.canonical.Unity.Launcher",
202+ "/com/canonical/Unity/Launcher/" + LauncherBackend::encodeAppId(appId),
203203 "org.freedesktop.DBus.Properties",
204204 "Get");
205205 QVariantList getargs;
206− getargs.append(QString("com.canonical.unity.Launcher.Item"));
206+ getargs.append(QString("com.canonical.Unity.Launcher.Item"));
207207 getargs.append(QString("count"));
208208
209209 message.setArguments(getargs);