Merge lp:~nick-dedekind/unity8/lp1226650 into lp:unity8

Proposed by Nick Dedekind
Status: Merged
Approved by: MichaƂ Sawicz
Approved revision: 466
Merged at revision: 488
Proposed branch: lp:~nick-dedekind/unity8/lp1226650
Merge into: lp:unity8
Diff against target: 61 lines (+27/-6)
1 file modified
plugins/Unity/Indicators/qml/IndicatorPage.qml (+27/-6)
To merge this branch: bzr merge lp:~nick-dedekind/unity8/lp1226650
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michael Zanetti (community) Approve
Review via email: mp+191447@code.launchpad.net

Commit message

Faster loading of indicator menus.

Description of the change

Faster loading of indicator menus.

Changes
=======
Previously the menu model parent node was found by loading it into the listview and parsing the data for the correct type.
This required the loader to be asynchronous due to a binding loop as well as the view to change it's model.

Now we find the parent node by parsing the type of the model stacks tail's first row, and use it's submenu as the listview model.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:466
http://jenkins.qa.ubuntu.com/job/unity8-ci/1436/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/5070
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/3009/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2304
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/459
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1436
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1436/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1435
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1239
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/945
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/945/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3011
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3011/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2517/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2561
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/44
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/40

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1436/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

lgtm. Very nice speed improvement.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/626/
Executed test runs:
    SUCCESS: http://10.97.0.26:8080/job/generic-cleanup-mbs/3064
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/301
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/291/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/83
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-autolanding/12
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/12
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/12/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-autolanding/12
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/284
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/301
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/301/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/291
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/291/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2907/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2959
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/860
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/863

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Unity/Indicators/qml/IndicatorPage.qml'
2--- plugins/Unity/Indicators/qml/IndicatorPage.qml 2013-09-30 16:37:55 +0000
3+++ plugins/Unity/Indicators/qml/IndicatorPage.qml 2013-10-16 15:57:58 +0000
4@@ -34,11 +34,36 @@
5 Indicators.UnityMenuModelStack {
6 id: menuStack
7 head: contentActive ? main.menuModel : null
8+
9+ property var rootMenu: null
10+
11+ onTailChanged: {
12+ if (!tail) {
13+ rootMenu = null;
14+ } else if (rootMenu != tail) {
15+ if (tail.get(0, "type") === rootMenuType) {
16+ rootMenu = menuStack.tail.submenu(0);
17+ push(rootMenu, 0);
18+ } else {
19+ rootMenu = null;
20+ }
21+ }
22+ }
23+ }
24+
25+ Connections {
26+ target: menuStack.tail
27+ onRowsInserted: {
28+ if (menuStack.rootMenu !== menuStack.tail && menuStack.tail.get(0, "type") === rootMenuType) {
29+ menuStack.rootMenu = menuStack.tail.submenu(0);
30+ menuStack.push(menuStack.rootMenu, 0);
31+ }
32+ }
33 }
34
35 ListView {
36 id: mainMenu
37- model: menuStack.tail ? menuStack.tail : null
38+ model: menuStack.rootMenu
39
40 anchors {
41 fill: parent
42@@ -102,7 +127,7 @@
43
44 Loader {
45 id: loader
46- asynchronous: true
47+ asynchronous: false
48
49 property int modelIndex: index
50
51@@ -114,10 +139,6 @@
52 sourceComponent: factory.load(model)
53
54 onLoaded: {
55- if (model.type === rootMenuType) {
56- menuStack.push(mainMenu.model.submenu(index));
57- }
58-
59 if (item.hasOwnProperty("menuSelected")) {
60 item.menuSelected = Qt.binding(function() { return mainMenu.selectedIndex == index; });
61 item.selectMenu.connect(function() { mainMenu.selectedIndex = index; });

Subscribers

People subscribed via source and target branches