Merge lp:~zsombi/ubuntu-ui-toolkit/asyncAPL into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1842
Merged at revision: 1867
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/asyncAPL
Merge into: lp:ubuntu-ui-toolkit/staging
Prerequisite: lp:~zsombi/ubuntu-ui-toolkit/redoSoneTests
Diff against target: 96 lines (+32/-7)
3 files modified
components.api (+1/-0)
src/Ubuntu/Components/1.3/AdaptivePageLayout.qml (+12/-7)
tests/unit_x11/tst_components/tst_adaptivepagelayout.qml (+19/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/asyncAPL
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+285686@code.launchpad.net

This proposal supersedes a proposal from 2016-02-10.

Commit message

Introduce AdaptivePageLayout.asynchronous to the API.

To post a comment you must log in.
Revision history for this message
Andrea Bernabei (faenil) wrote : Posted in a previous version of this proposal

just a tiny comment

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote : Posted in a previous version of this proposal

- property color highlightColor: theme.palette.highlight.baseText
69 + property color highlightColor: theme.palette.highlighted.baseText

Rogue change?

Other than that, looks good to me.

review: Needs Fixing
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

Looks good now!

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
1842. By Zsombor Egri

staging sync

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2016-02-17 12:57:49 +0000
3+++ components.api 2016-02-24 06:41:18 +0000
4@@ -83,6 +83,7 @@
5 property bool onScreen
6 property bool running
7 Ubuntu.Components.AdaptivePageLayout 1.3: PageTreeNode
8+ property bool asynchronous
9 readonly property int columns
10 property list<PageColumnsLayou> layouts
11 function var addPageToCurrentColumn(var sourcePage, var page, var properties)
12
13=== modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml'
14--- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2016-02-15 13:19:05 +0000
15+++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2016-02-24 06:41:18 +0000
16@@ -216,13 +216,17 @@
17 /*!
18 The property specifies the source of the primaryPage in case the primary
19 page is created from a Component or loaded from an external document. It
20- has precedence over \l primaryPage. The page specified in this way will
21- be cerated asynchronously and the instance will be reported through
22- \l primaryPage property.
23+ has precedence over \l primaryPage.
24 */
25 property var primaryPageSource
26
27 /*!
28+ The property drives the way the pages should be loaded, synchronously or
29+ asynchronously. Defaults to true.
30+ */
31+ property bool asynchronous: true
32+
33+ /*!
34 \qmlproperty int columns
35 \readonly
36 The property holds the number of columns shown in the layout.
37@@ -244,9 +248,10 @@
38 is created. \c sourcePage must be active.
39
40 The function creates the new page asynchronously if the new \c page to be
41- added is a Component or a QML document. In this case the function returns
42- an incubator which can be used to track the page creation.For more about
43- incubation in QML and creating components asynchronously, see
44+ added is a Component or a QML document and the \l asynchronous property is
45+ set to true. In this case the function returns an incubator which can be
46+ used to track the page creation. For more about incubation in QML and creating
47+ components asynchronously, see
48 \l {http://doc.qt.io/qt-5/qml-qtqml-component.html#incubateObject-method}
49 {Component.incubateObject()}.
50 The following example removes an element from the list model whenever the
51@@ -463,7 +468,7 @@
52 }
53
54 function createWrapper(page, properties) {
55- var wrapperObject = pageWrapperComponent.createObject(hiddenPages, {synchronous: false});
56+ var wrapperObject = pageWrapperComponent.createObject(hiddenPages, {synchronous: !layout.asynchronous});
57 wrapperObject.pageStack = layout;
58 wrapperObject.properties = properties;
59 // set reference last because it will trigger creation of the object
60
61=== modified file 'tests/unit_x11/tst_components/tst_adaptivepagelayout.qml'
62--- tests/unit_x11/tst_components/tst_adaptivepagelayout.qml 2016-01-18 17:06:47 +0000
63+++ tests/unit_x11/tst_components/tst_adaptivepagelayout.qml 2016-02-24 06:41:18 +0000
64@@ -160,6 +160,7 @@
65 compare(defaults.primaryPageSource, undefined, "primaryPageSource not set by default");
66 compare(defaults.layouts.length, 0, "no layouts by default");
67 compare(defaults.columns, columns, columns + " column(s) as default");
68+ compare(defaults.asynchronous, true, "default page loading is asynchronous");
69
70 verify(page1.active, "Page1 is not active but should be! Bug(1535241)");
71 verify(!page2.active, "Page2 is active but should not be! Bug(1535241)");
72@@ -290,6 +291,24 @@
73 }
74 }
75
76+ function test_forced_synchronous_loading_bug1540449_data() {
77+ return [
78+ {tag: "To current column", func: "addPageToCurrentColumn", page: pageComponent, expectedTitle: "DynamicPage"},
79+ {tag: "To next column", func: "addPageToNextColumn", page: pageComponent, expectedTitle: "DynamicPage"},
80+ ];
81+ }
82+ function test_forced_synchronous_loading_bug1540449(data) {
83+ layout[data.func](layout.primaryPage, data.page);
84+ waitForRendering(layout, 400);
85+
86+ var wrapper = getPageWrapper(layout, layout.primaryPage);
87+ verify(wrapper);
88+ var testColumn = MathUtils.clamp(wrapper.column + (data.func == "addPageToCurrentColumn" ? 0 : 1),
89+ 0, layout.columns - 1);
90+ var testHolder = getColumnHolder(layout, testColumn);
91+ compare(testHolder.pageWrapper.object.title, data.expectedTitle, "page not found");
92+ }
93+
94 function test_asynchronous_page_loading_incubator_forcecompletion() {
95 var incubator = layout.addPageToCurrentColumn(layout.primaryPage, pageComponent);
96 verify(incubator, "Page added synchronously!");

Subscribers

People subscribed via source and target branches