on xenial help sign in
switch to proper dbus interface
commit2833057eaf143930bf4f372c7cc325195ee89843 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 26 Aug 2014, 21:54 (12 years ago) parent8ae76b2
1 file changed+12−12
plugins/Unity/Launcher/dbusinterface.cpp+12−12
plugins/Unity/Launcher/dbusinterface.cpp+12−12
@@ -13,10 +13,10 @@ DBusInterface::DBusInterface(LauncherModel *parent):
1313{
1414 /* Set up ourselves on DBus */
1515 QDBusConnection con = QDBusConnection::sessionBus();
16− if (!con.registerService("com.canonical.Unity.Launcher2")) {
16+ if (!con.registerService("com.canonical.Unity.Launcher")) {
1717 qWarning() << "Unable to register launcher name";
1818 }
19− if (!con.registerVirtualObject("/com/canonical/Unity/Launcher2", this, QDBusConnection::VirtualObjectRegisterOption::SubPath)) {
19+ if (!con.registerVirtualObject("/com/canonical/Unity/Launcher", this, QDBusConnection::VirtualObjectRegisterOption::SubPath)) {
2020 qWarning() << "Unable to register launcher object";
2121 }
2222}
@@ -25,19 +25,19 @@ DBusInterface::~DBusInterface()
2525{
2626 /* Remove oursevles from DBus */
2727 QDBusConnection con = QDBusConnection::sessionBus();
28− con.unregisterService("com.canonical.Unity.Launcher2");
29− con.unregisterObject("/com/canonical/Unity/Launcher2");
28+ con.unregisterService("com.canonical.Unity.Launcher");
29+ con.unregisterObject("/com/canonical/Unity/Launcher");
3030}
3131
3232QString DBusInterface::introspect(const QString &path) const
3333{
3434 qDebug() << "introspecting" << path;
3535 /* This case we should just list the nodes */
36− if (path == "/com/canonical/Unity/Launcher2/" || path == "/com/canonical/Unity/Launcher2") {
36+ if (path == "/com/canonical/Unity/Launcher/" || path == "/com/canonical/Unity/Launcher") {
3737 QString nodes;
3838
3939 // Add Refresh to introspect
40− nodes = "<interface name=\"com.canonical.Unity.Launcher2\">"
40+ nodes = "<interface name=\"com.canonical.Unity.Launcher\">"
4141 "<method name=\"Refresh\"/>"
4242 "</interface>";
4343
@@ -51,13 +51,13 @@ QString DBusInterface::introspect(const QString &path) const
5151 }
5252
5353 /* Should not happen, but let's handle it */
54− if (!path.startsWith("/com/canonical/Unity/Launcher2")) {
54+ if (!path.startsWith("/com/canonical/Unity/Launcher")) {
5555 return "";
5656 }
5757
5858 /* Now we should be looking at a node */
5959 QString nodeiface =
60− "<interface name=\"com.canonical.Unity.Launcher2.Item\">"
60+ "<interface name=\"com.canonical.Unity.Launcher.Item\">"
6161 "<property name=\"count\" type=\"i\" access=\"readwrite\" />"
6262 "<property name=\"countVisible\" type=\"b\" access=\"readwrite\" />"
6363 "</interface>";
@@ -134,16 +134,16 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
134134 return false;
135135 }
136136
137− if (message.member() != "GetAll" && message.arguments()[0].toString() != "com.canonical.Unity.Launcher2.Item") {
137+ if (message.member() != "GetAll" && message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item") {
138138 return false;
139139 }
140140
141141 /* Break down the path to just the app id */
142142 QString pathtemp = message.path();
143− if (!pathtemp.startsWith("/com/canonical/Unity/Launcher2/")) {
143+ if (!pathtemp.startsWith("/com/canonical/Unity/Launcher/")) {
144144 return false;
145145 }
146− pathtemp.remove("/com/canonical/Unity/Launcher2/");
146+ pathtemp.remove("/com/canonical/Unity/Launcher/");
147147 if (pathtemp.indexOf('/') >= 0) {
148148 return false;
149149 }
@@ -194,7 +194,7 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
194194
195195void DBusInterface::emitPropChangedDbus(const QString& appId, const QString& property, const QVariant &value)
196196{
197− QString path("/com/canonical/Unity/Launcher2/");
197+ QString path("/com/canonical/Unity/Launcher/");
198198 path.append(encodeAppId(appId));
199199
200200 QDBusMessage message = QDBusMessage::createSignal(path, "org.freedesktop.DBus.Properties", "PropertiesChanged");