on xenial help sign in
merge trunk
commitc038967b83ab13ff197b99f5e6172280177ec8d6 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 8 Jul 2016, 17:16 (10 years ago) parent3f1b650357bb90
5 files changed+46−2
debian/changelog+8 plugins/Unity/Launcher/launchermodel.cpp+1−1 po/unity8.pot+1−1 tests/plugins/Unity/Launcher/launchermodeltest.cpp+21 tests/qmltests/Launcher/tst_Launcher.qml+15
debian/changelog+8
@@ -1,3 +1,11 @@
1+unity8 (8.12+16.10.20160707-0ubuntu1) yakkety; urgency=medium
2+
3+ [ Michael Zanetti ]
4+ * emit the correct role changed signal on count visible changed (LP:
5+ #1599925)
6+
7+ -- Michał Sawicz <michal.sawicz@canonical.com> Thu, 07 Jul 2016 16:49:32 +0000
8+
19unity8 (8.12+16.10.20160705-0ubuntu1) yakkety; urgency=medium
210
311 [ Michael Zanetti ]
plugins/Unity/Launcher/launchermodel.cpp+1−1
@@ -365,7 +365,7 @@ void LauncherModel::countVisibleChanged(const QString &appId, bool countVisible)
365365 if (idx >= 0) {
366366 LauncherItem *item = m_list.at(idx);
367367 item->setCountVisible(countVisible);
368− QVector<int> changedRoles = {RoleCount};
368+ QVector<int> changedRoles = {RoleCountVisible};
369369 if (countVisible && !item->alerting() && !item->focused()) {
370370 changedRoles << RoleAlerting;
371371 item->setAlerting(true);
po/unity8.pot+1−1
@@ -8,7 +8,7 @@ msgid ""
88msgstr ""
99"Project-Id-Version: unity8\n"
1010"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2016-07-05 10:00+0000\n"
11+"POT-Creation-Date: 2016-07-07 16:49+0000\n"
1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414"Language-Team: LANGUAGE <LL@li.org>\n"
tests/plugins/Unity/Launcher/launchermodeltest.cpp+21
@@ -492,6 +492,27 @@ private Q_SLOTS:
492492 // Finally check, that the change to "count" implicitly also set the alerting-state to true
493493 QVERIFY(launcherModel->get(index)->alerting() == true);
494494
495+ // Check if the launcher emitted the changed signals
496+ QCOMPARE(spy.count(), 2);
497+
498+ QVariantList countEmissionArgs = spy.takeFirst();
499+ QCOMPARE(countEmissionArgs.at(0).value<QModelIndex>().row(), index);
500+ QCOMPARE(countEmissionArgs.at(1).value<QModelIndex>().row(), index);
501+ QVector<int> roles = countEmissionArgs.at(2).value<QVector<int> >();
502+ QCOMPARE(roles.first(), (int)LauncherModel::RoleCount);
503+
504+ QVariantList countVisibleEmissionArgs = spy.takeFirst();
505+ QCOMPARE(countVisibleEmissionArgs.at(0).value<QModelIndex>().row(), index);
506+ QCOMPARE(countVisibleEmissionArgs.at(1).value<QModelIndex>().row(), index);
507+ roles = countVisibleEmissionArgs.at(2).value<QVector<int> >();
508+ QVERIFY(roles.contains(LauncherModel::RoleCountVisible));
509+ QVERIFY(roles.contains(LauncherModel::RoleAlerting));
510+
511+ // Check if the values match
512+ QCOMPARE(launcherModel->get(index)->countVisible(), true);
513+ QCOMPARE(launcherModel->get(index)->count(), 55);
514+ QCOMPARE(launcherModel->get(index)->alerting(), true);
515+
495516 // Focus the app, make sure the alert gets cleared
496517 appManager->focusApplication("abs-icon");
497518 QVERIFY(launcherModel->get(index)->alerting() == false);
tests/qmltests/Launcher/tst_Launcher.qml+15
@@ -203,6 +203,21 @@ Rectangle {
203203 onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntryAlert.displayText)).appId, false)
204204 }
205205 }
206+
207+ Row {
208+ spacing: units.gu(1)
209+ Button {
210+ text: "Toggle count visible"
211+ onClicked: {
212+ var item = LauncherModel.get(parseInt(appIdEntryCountVisible.displayText))
213+ LauncherModel.setCountVisible(item.appId, !item.countVisible)
214+ }
215+ }
216+ TextField {
217+ id: appIdEntryCountVisible
218+ text: "0"
219+ }
220+ }
206221 }
207222
208223 SignalSpy {