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