on xenial help sign in
Fix DBusVariant conversion for launcher emblems Fixes: 1387261

Approved by: Albert Astals Cid

commita1fa256f491e551565d653dc39167b95a04d3bfe authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 4 Nov 2014, 12:53 (12 years ago) parentedc17892682bc3
2 files changed+4−4
plugins/Unity/Launcher/dbusinterface.cpp+2−2 tests/plugins/Unity/Launcher/launchermodeltest.cpp+2−2
plugins/Unity/Launcher/dbusinterface.cpp+2−2
@@ -171,13 +171,13 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
171171 }
172172 } else if (message.member() == "Set") {
173173 if (message.arguments()[1].toString() == "count") {
174− int newCount = message.arguments()[2].toInt();
174+ int newCount = message.arguments()[2].value<QDBusVariant>().variant().toInt();
175175 if (!item || newCount != item->count()) {
176176 Q_EMIT countChanged(appid, newCount);
177177 notifyPropertyChanged("com.canonical.Unity.Launcher.Item", encodeAppId(appid), "count", QVariant(newCount));
178178 }
179179 } else if (message.arguments()[1].toString() == "countVisible") {
180− bool newVisible = message.arguments()[2].toBool();
180+ bool newVisible = message.arguments()[2].value<QDBusVariant>().variant().toBool();
181181 if (!item || newVisible != item->countVisible()) {
182182 Q_EMIT countVisibleChanged(appid, newVisible);
183183 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:
365365 QCOMPARE(map.value("countVisible").toBool(), false);
366366
367367 // Now make it visible and set it to 55 through D-Bus
368− interface.call("Set", "com.canonical.Unity.Launcher.Item", "count", 55);
369− interface.call("Set", "com.canonical.Unity.Launcher.Item", "countVisible", true);
368+ interface.call("Set", "com.canonical.Unity.Launcher.Item", "count", QVariant::fromValue(QDBusVariant(55)));
369+ interface.call("Set", "com.canonical.Unity.Launcher.Item", "countVisible", QVariant::fromValue(QDBusVariant(true)));
370370
371371 // Fetch it again using GetAll
372372 reply = interface.call("GetAll");