on xenial help sign in
merge trunk
c038967Lukáš Tinkl
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+
1unity8 (8.12+16.10.20160705-0ubuntu1) yakkety; urgency=medium
9unity8 (8.12+16.10.20160705-0ubuntu1) yakkety; urgency=medium
2
10
3 [ Michael Zanetti ]
11 [ Michael Zanetti ]
plugins/Unity/Launcher/launchermodel.cpp+1−1
@@ -365,7 +365,7 @@ void LauncherModel::countVisibleChanged(const QString &appId, bool countVisible)
365 if (idx >= 0) {
365 if (idx >= 0) {
366 LauncherItem *item = m_list.at(idx);
366 LauncherItem *item = m_list.at(idx);
367 item->setCountVisible(countVisible);
367 item->setCountVisible(countVisible);
368− QVector<int> changedRoles = {RoleCount};
368+ QVector<int> changedRoles = {RoleCountVisible};
369 if (countVisible && !item->alerting() && !item->focused()) {
369 if (countVisible && !item->alerting() && !item->focused()) {
370 changedRoles << RoleAlerting;
370 changedRoles << RoleAlerting;
371 item->setAlerting(true);
371 item->setAlerting(true);
po/unity8.pot+1−1
@@ -8,7 +8,7 @@ msgid ""
8msgstr ""
8msgstr ""
9"Project-Id-Version: unity8\n"
9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"
10"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"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
tests/plugins/Unity/Launcher/launchermodeltest.cpp+21
@@ -492,6 +492,27 @@ private Q_SLOTS:
492 // Finally check, that the change to "count" implicitly also set the alerting-state to true
492 // Finally check, that the change to "count" implicitly also set the alerting-state to true
493 QVERIFY(launcherModel->get(index)->alerting() == true);
493 QVERIFY(launcherModel->get(index)->alerting() == true);
494
494
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+
495 // Focus the app, make sure the alert gets cleared
516 // Focus the app, make sure the alert gets cleared
496 appManager->focusApplication("abs-icon");
517 appManager->focusApplication("abs-icon");
497 QVERIFY(launcherModel->get(index)->alerting() == false);
518 QVERIFY(launcherModel->get(index)->alerting() == false);
tests/qmltests/Launcher/tst_Launcher.qml+15
@@ -203,6 +203,21 @@ Rectangle {
203 onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntryAlert.displayText)).appId, false)
203 onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntryAlert.displayText)).appId, false)
204 }
204 }
205 }
205 }
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+ }
206 }
221 }
207
222
208 SignalSpy {
223 SignalSpy {