on xenial help sign in
Some tabs snuck in
267a16bTed Gould
plugins/Unity/Launcher/backend/launcherbackend.cpp+9−9
@@ -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";
55− }
55+ }
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";
58− }
58+ }
59}
59}
60
60
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;
430− }
430+ }
431 if (message.interface() != "org.freedesktop.DBus.Properties") {
431 if (message.interface() != "org.freedesktop.DBus.Properties") {
432 return false;
432 return false;
433− }
433+ }
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;
436− }
436+ }
437
437
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;
442− }
442+ }
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;
446− }
446+ }
447
447
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))));
457− }
457+ }
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());
463− }
463+ }
464 } else if (message.member() == "GetAll") {
464 } else if (message.member() == "GetAll") {
465 retval.append(this->itemToVariant(appid));
465 retval.append(this->itemToVariant(appid));
466 } else {
466 } else {