@@ -52,10 +52,10 @@ LauncherBackend::LauncherBackend(QObject *parent):
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";
56 if (!con.registerVirtualObject("/com/canonical/Unity/Launcher", this, QDBusConnection::VirtualObjectRegisterOption::SubPath)) {
56 if (!con.registerVirtualObject("/com/canonical/Unity/Launcher", this, QDBusConnection::VirtualObjectRegisterOption::SubPath)) {
57 qDebug() << "Unable to register launcher object";
57 qDebug() << "Unable to register launcher object";
61LauncherBackend::~LauncherBackend()
61LauncherBackend::~LauncherBackend()
@@ -427,23 +427,23 @@ bool LauncherBackend::handleMessage(const QDBusMessage& message, const QDBusConn
427 /* Check to make sure we're getting properties on our interface */
427 /* Check to make sure we're getting properties on our interface */
428 if (message.type() != QDBusMessage::MessageType::MethodCallMessage) {
428 if (message.type() != QDBusMessage::MessageType::MethodCallMessage) {
429 return false;
429 return false;
431 if (message.interface() != "org.freedesktop.DBus.Properties") {
431 if (message.interface() != "org.freedesktop.DBus.Properties") {
432 return false;
432 return false;
434 if (message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item") {
434 if (message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item") {
435 return false;
435 return false;
438 /* Break down the path to just the app id */
438 /* Break down the path to just the app id */
439 QString pathtemp = message.path();
439 QString pathtemp = message.path();
440 if (!pathtemp.startsWith("/com/canonical/Unity/Launcher/")) {
440 if (!pathtemp.startsWith("/com/canonical/Unity/Launcher/")) {
441 return false;
441 return false;
443 pathtemp.remove("/com/canonical/Unity/Launcher/");
443 pathtemp.remove("/com/canonical/Unity/Launcher/");
444 if (pathtemp.indexOf('/') >= 0) {
444 if (pathtemp.indexOf('/') >= 0) {
445 return false;
445 return false;
448 /* Find ourselves an appid */
448 /* Find ourselves an appid */
449 QString appid = decodeAppId(pathtemp);
449 QString appid = decodeAppId(pathtemp);
@@ -454,13 +454,13 @@ bool LauncherBackend::handleMessage(const QDBusMessage& message, const QDBusConn
454 retval.append(QVariant::fromValue(QDBusVariant(this->count(appid))));
454 retval.append(QVariant::fromValue(QDBusVariant(this->count(appid))));
455 } else if (message.arguments()[1].toString() == "countVisible") {
455 } else if (message.arguments()[1].toString() == "countVisible") {
456 retval.append(QVariant::fromValue(QDBusVariant(this->countVisible(appid))));
456 retval.append(QVariant::fromValue(QDBusVariant(this->countVisible(appid))));
458 } else if (message.member() == "Set") {
458 } else if (message.member() == "Set") {
459 if (message.arguments()[1].toString() == "count") {
459 if (message.arguments()[1].toString() == "count") {
460 this->setCount(appid, message.arguments()[2].value<QDBusVariant>().variant().toInt());
460 this->setCount(appid, message.arguments()[2].value<QDBusVariant>().variant().toInt());
461 } else if (message.arguments()[1].toString() == "countVisible") {
461 } else if (message.arguments()[1].toString() == "countVisible") {
462 this->setCountVisible(appid, message.arguments()[2].value<QDBusVariant>().variant().toBool());
462 this->setCountVisible(appid, message.arguments()[2].value<QDBusVariant>().variant().toBool());
464 } else if (message.member() == "GetAll") {
464 } else if (message.member() == "GetAll") {
465 retval.append(this->itemToVariant(appid));
465 retval.append(this->itemToVariant(appid));