on xenial help sign in
Making a change to count and countEmblemVisible via LauncherModel implicitly sets the alert-state on the affected item... extended LauncherModel's unit-test accordingly.
commit2ab85743ccc57c829f490cf7b43e29e79a46a82e authorMirco Müller <mirco.mueller@ubuntu.com> dateWed 24 Jun 2015, 12:51 (11 years ago) parentfdc265f
2 files changed+7
plugins/Unity/Launcher/launchermodel.cpp+6 tests/plugins/Unity/Launcher/launchermodeltest.cpp+1
plugins/Unity/Launcher/launchermodel.cpp+6
@@ -348,6 +348,9 @@ void LauncherModel::countChanged(const QString &appId, int count)
348348 if (idx >= 0) {
349349 LauncherItem *item = m_list.at(idx);
350350 item->setCount(count);
351+ if (item->countVisible()) {
352+ item->setAlerting(true);
353+ }
351354 Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleCount);
352355 m_asAdapter->syncItems(m_list);
353356 }
@@ -359,6 +362,9 @@ void LauncherModel::countVisibleChanged(const QString &appId, int countVisible)
359362 if (idx >= 0) {
360363 LauncherItem *item = m_list.at(idx);
361364 item->setCountVisible(countVisible);
365+ if (countVisible) {
366+ item->setAlerting(true);
367+ }
362368 Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleCountVisible);
363369
364370 // If countVisible goes to false, and the item is neither pinned nor recent we can drop it
tests/plugins/Unity/Launcher/launchermodeltest.cpp+1
@@ -400,6 +400,7 @@ private Q_SLOTS:
400400 // And make sure values have changed there as well
401401 QCOMPARE(launcherModel->get(index)->countVisible(), true);
402402 QCOMPARE(launcherModel->get(index)->count(), 55);
403+ QVERIFY(launcherModel->get(index)->alerting() == true);
403404 }
404405
405406 void testCountEmblemAddsRemovesItem_data() {