on xenial help sign in
fix DBusVariant converion
2682bc3Michael Zanetti
plugins/Unity/Launcher/dbusinterface.cpp+2−2
@@ -183,13 +183,13 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
183 }
183 }
184 } else if (message.member() == "Set") {
184 } else if (message.member() == "Set") {
185 if (message.arguments()[1].toString() == "count") {
185 if (message.arguments()[1].toString() == "count") {
186− int newCount = message.arguments()[2].toInt();
186+ int newCount = message.arguments()[2].value<QDBusVariant>().variant().toInt();
187 if (!item || newCount != item->count()) {
187 if (!item || newCount != item->count()) {
188 Q_EMIT countChanged(appid, newCount);
188 Q_EMIT countChanged(appid, newCount);
189 emitPropChangedDbus(appid, "count", QVariant(newCount));
189 emitPropChangedDbus(appid, "count", QVariant(newCount));
190 }
190 }
191 } else if (message.arguments()[1].toString() == "countVisible") {
191 } else if (message.arguments()[1].toString() == "countVisible") {
192− bool newVisible = message.arguments()[2].toBool();
192+ bool newVisible = message.arguments()[2].value<QDBusVariant>().variant().toBool();
193 if (!item || newVisible != item->countVisible()) {
193 if (!item || newVisible != item->countVisible()) {
194 Q_EMIT countVisibleChanged(appid, newVisible);
194 Q_EMIT countVisibleChanged(appid, newVisible);
195 emitPropChangedDbus(appid, "countVisible", newVisible);
195 emitPropChangedDbus(appid, "countVisible", newVisible);
tests/plugins/Unity/Launcher/launchermodeltest.cpp+2−2
@@ -351,8 +351,8 @@ private Q_SLOTS:
351 QCOMPARE(map.value("countVisible").toBool(), false);
351 QCOMPARE(map.value("countVisible").toBool(), false);
352
352
353 // Now make it visible and set it to 55 through D-Bus
353 // Now make it visible and set it to 55 through D-Bus
354− interface.call("Set", "com.canonical.Unity.Launcher.Item", "count", 55);
354+ interface.call("Set", "com.canonical.Unity.Launcher.Item", "count", QVariant::fromValue(QDBusVariant(55)));
355− interface.call("Set", "com.canonical.Unity.Launcher.Item", "countVisible", true);
355+ interface.call("Set", "com.canonical.Unity.Launcher.Item", "countVisible", QVariant::fromValue(QDBusVariant(true)));
356
356
357 // Fetch it again using GetAll
357 // Fetch it again using GetAll
358 reply = interface.call("GetAll");
358 reply = interface.call("GetAll");