Merge lp:~mzanetti/unity8/fix-1599925 into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Michał Sawicz
Approved revision: 2533
Merged at revision: 2533
Proposed branch: lp:~mzanetti/unity8/fix-1599925
Merge into: lp:unity8
Diff against target: 70 lines (+37/-1)
3 files modified
plugins/Unity/Launcher/launchermodel.cpp (+1/-1)
tests/plugins/Unity/Launcher/launchermodeltest.cpp (+21/-0)
tests/qmltests/Launcher/tst_Launcher.qml (+15/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/fix-1599925
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Michał Sawicz Approve
Review via email: mp+299443@code.launchpad.net

Commit message

emit the correct role changed signal on count visible changed

Description of the change

* no additional branches required

* Tested on flo.

* waiting on CI still

* no ui change

* no package change

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) :
review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2533
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1689/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2236
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1198
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1198
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1198
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2264
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2170
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2170
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2170
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2161
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2161/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2161
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2161/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2161
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2161/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2161
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2161/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2161
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2161/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2161
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2161/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2161
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2161/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2161
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2161/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2161
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2161/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1689/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Unity/Launcher/launchermodel.cpp'
2--- plugins/Unity/Launcher/launchermodel.cpp 2016-05-19 16:11:10 +0000
3+++ plugins/Unity/Launcher/launchermodel.cpp 2016-07-07 16:20:56 +0000
4@@ -365,7 +365,7 @@
5 if (idx >= 0) {
6 LauncherItem *item = m_list.at(idx);
7 item->setCountVisible(countVisible);
8- QVector<int> changedRoles = {RoleCount};
9+ QVector<int> changedRoles = {RoleCountVisible};
10 if (countVisible && !item->alerting() && !item->focused()) {
11 changedRoles << RoleAlerting;
12 item->setAlerting(true);
13
14=== modified file 'tests/plugins/Unity/Launcher/launchermodeltest.cpp'
15--- tests/plugins/Unity/Launcher/launchermodeltest.cpp 2016-05-19 16:11:10 +0000
16+++ tests/plugins/Unity/Launcher/launchermodeltest.cpp 2016-07-07 16:20:56 +0000
17@@ -492,6 +492,27 @@
18 // Finally check, that the change to "count" implicitly also set the alerting-state to true
19 QVERIFY(launcherModel->get(index)->alerting() == true);
20
21+ // Check if the launcher emitted the changed signals
22+ QCOMPARE(spy.count(), 2);
23+
24+ QVariantList countEmissionArgs = spy.takeFirst();
25+ QCOMPARE(countEmissionArgs.at(0).value<QModelIndex>().row(), index);
26+ QCOMPARE(countEmissionArgs.at(1).value<QModelIndex>().row(), index);
27+ QVector<int> roles = countEmissionArgs.at(2).value<QVector<int> >();
28+ QCOMPARE(roles.first(), (int)LauncherModel::RoleCount);
29+
30+ QVariantList countVisibleEmissionArgs = spy.takeFirst();
31+ QCOMPARE(countVisibleEmissionArgs.at(0).value<QModelIndex>().row(), index);
32+ QCOMPARE(countVisibleEmissionArgs.at(1).value<QModelIndex>().row(), index);
33+ roles = countVisibleEmissionArgs.at(2).value<QVector<int> >();
34+ QVERIFY(roles.contains(LauncherModel::RoleCountVisible));
35+ QVERIFY(roles.contains(LauncherModel::RoleAlerting));
36+
37+ // Check if the values match
38+ QCOMPARE(launcherModel->get(index)->countVisible(), true);
39+ QCOMPARE(launcherModel->get(index)->count(), 55);
40+ QCOMPARE(launcherModel->get(index)->alerting(), true);
41+
42 // Focus the app, make sure the alert gets cleared
43 appManager->focusApplication("abs-icon");
44 QVERIFY(launcherModel->get(index)->alerting() == false);
45
46=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
47--- tests/qmltests/Launcher/tst_Launcher.qml 2016-06-15 14:36:15 +0000
48+++ tests/qmltests/Launcher/tst_Launcher.qml 2016-07-07 16:20:56 +0000
49@@ -203,6 +203,21 @@
50 onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntryAlert.displayText)).appId, false)
51 }
52 }
53+
54+ Row {
55+ spacing: units.gu(1)
56+ Button {
57+ text: "Toggle count visible"
58+ onClicked: {
59+ var item = LauncherModel.get(parseInt(appIdEntryCountVisible.displayText))
60+ LauncherModel.setCountVisible(item.appId, !item.countVisible)
61+ }
62+ }
63+ TextField {
64+ id: appIdEntryCountVisible
65+ text: "0"
66+ }
67+ }
68 }
69
70 SignalSpy {

Subscribers

People subscribed via source and target branches