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
=== modified file 'plugins/Unity/Indicators/qml/IndicatorPage.qml'
--- plugins/Unity/Indicators/qml/IndicatorPage.qml 2013-09-30 16:37:55 +0000
+++ plugins/Unity/Indicators/qml/IndicatorPage.qml 2013-10-16 15:57:58 +0000
@@ -34,11 +34,36 @@
34 Indicators.UnityMenuModelStack {34 Indicators.UnityMenuModelStack {
35 id: menuStack35 id: menuStack
36 head: contentActive ? main.menuModel : null36 head: contentActive ? main.menuModel : null
37
38 property var rootMenu: null
39
40 onTailChanged: {
41 if (!tail) {
42 rootMenu = null;
43 } else if (rootMenu != tail) {
44 if (tail.get(0, "type") === rootMenuType) {
45 rootMenu = menuStack.tail.submenu(0);
46 push(rootMenu, 0);
47 } else {
48 rootMenu = null;
49 }
50 }
51 }
52 }
53
54 Connections {
55 target: menuStack.tail
56 onRowsInserted: {
57 if (menuStack.rootMenu !== menuStack.tail && menuStack.tail.get(0, "type") === rootMenuType) {
58 menuStack.rootMenu = menuStack.tail.submenu(0);
59 menuStack.push(menuStack.rootMenu, 0);
60 }
61 }
37 }62 }
3863
39 ListView {64 ListView {
40 id: mainMenu65 id: mainMenu
41 model: menuStack.tail ? menuStack.tail : null66 model: menuStack.rootMenu
4267
43 anchors {68 anchors {
44 fill: parent69 fill: parent
@@ -102,7 +127,7 @@
102127
103 Loader {128 Loader {
104 id: loader129 id: loader
105 asynchronous: true130 asynchronous: false
106131
107 property int modelIndex: index132 property int modelIndex: index
108133
@@ -114,10 +139,6 @@
114 sourceComponent: factory.load(model)139 sourceComponent: factory.load(model)
115140
116 onLoaded: {141 onLoaded: {
117 if (model.type === rootMenuType) {
118 menuStack.push(mainMenu.model.submenu(index));
119 }
120
121 if (item.hasOwnProperty("menuSelected")) {142 if (item.hasOwnProperty("menuSelected")) {
122 item.menuSelected = Qt.binding(function() { return mainMenu.selectedIndex == index; });143 item.menuSelected = Qt.binding(function() { return mainMenu.selectedIndex == index; });
123 item.selectMenu.connect(function() { mainMenu.selectedIndex = index; });144 item.selectMenu.connect(function() { mainMenu.selectedIndex = index; });

Subscribers

People subscribed via source and target branches