on xenial help sign in
Fix DBusVariant conversion for launcher emblems Fixes: 1387261
a1fa256Michael Zanetti
plugins/Unity/Launcher/dbusinterface.cpp+2−2
@@ -171,13 +171,13 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
171 }
171 }
172 } else if (message.member() == "Set") {
172 } else if (message.member() == "Set") {
173 if (message.arguments()[1].toString() == "count") {
173 if (message.arguments()[1].toString() == "count") {
174− int newCount = message.arguments()[2].toInt();
174+ int newCount = message.arguments()[2].value<QDBusVariant>().variant().toInt();
175 if (!item || newCount != item->count()) {
175 if (!item || newCount != item->count()) {
176 Q_EMIT countChanged(appid, newCount);
176 Q_EMIT countChanged(appid, newCount);
177 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "count", QVariant(newCount));
177 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "count", QVariant(newCount));
178 }
178 }
179 } else if (message.arguments()[1].toString() == "countVisible") {
179 } else if (message.arguments()[1].toString() == "countVisible") {
180− bool newVisible = message.arguments()[2].toBool();
180+ bool newVisible = message.arguments()[2].value<QDBusVariant>().variant().toBool();
181 if (!item || newVisible != item->countVisible()) {
181 if (!item || newVisible != item->countVisible()) {
182 Q_EMIT countVisibleChanged(appid, newVisible);
182 Q_EMIT countVisibleChanged(appid, newVisible);
183 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible);
183 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "countVisible", newVisible);
tests/plugins/Unity/Launcher/launchermodeltest.cpp+2−2
@@ -365,8 +365,8 @@ private Q_SLOTS:
365 QCOMPARE(map.value("countVisible").toBool(), false);
365 QCOMPARE(map.value("countVisible").toBool(), false);
366
366
367 // Now make it visible and set it to 55 through D-Bus
367 // Now make it visible and set it to 55 through D-Bus
368− interface.call("Set", "com.canonical.Unity.Launcher.Item", "count", 55);
368+ interface.call("Set", "com.canonical.Unity.Launcher.Item", "count", QVariant::fromValue(QDBusVariant(55)));
369− interface.call("Set", "com.canonical.Unity.Launcher.Item", "countVisible", true);
369+ interface.call("Set", "com.canonical.Unity.Launcher.Item", "countVisible", QVariant::fromValue(QDBusVariant(true)));
370
370
371 // Fetch it again using GetAll
371 // Fetch it again using GetAll
372 reply = interface.call("GetAll");
372 reply = interface.call("GetAll");