Merge lp:~aacid/unity8/expandable_model_not_array into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1185
Merged at revision: 1195
Proposed branch: lp:~aacid/unity8/expandable_model_not_array
Merge into: lp:unity8
Diff against target: 48 lines (+15/-9)
2 files modified
qml/Dash/Previews/PreviewExpandable.qml (+3/-3)
tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml (+12/-6)
To merge this branch: bzr merge lp:~aacid/unity8/expandable_model_not_array
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Paweł Stołowski (community) Approve
Andrea Cimitan (community) Approve
Review via email: mp+231708@code.launchpad.net

Commit message

PreviewExpandable: "widgets" is a model, not an array

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Andrea Cimitan (cimi) wrote :

Specs don't state whether should be an array or a model [1], so this branch is doing the same as previews with 'widgets' being a model.

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Let's wait a silo for that (requires integration), but code is fine
 * Did CI run pass? If not, please explain why.
Waiting CI

[1] https://docs.google.com/a/canonical.com/document/d/1NmiM4UCnJgf6IEawmfyTOHRNAA5ZGrqpyrPqPOibwc8/edit

review: Approve
Revision history for this message
Paweł Stołowski (stolowski) wrote :

LGTM; tested with my WIP branches of scopes api and shell plugin before and after the change, and it now works.

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

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
N, temporary fail in ap and known broken qml test.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/Previews/PreviewExpandable.qml'
2--- qml/Dash/Previews/PreviewExpandable.qml 2014-08-13 10:29:21 +0000
3+++ qml/Dash/Previews/PreviewExpandable.qml 2014-08-21 11:25:15 +0000
4@@ -80,9 +80,9 @@
5 delegate: PreviewWidgetFactory {
6 height: visible ? implicitHeight : 0
7 width: parent.width
8- widgetId: modelData.widgetId
9- widgetType: modelData.type
10- widgetData: modelData.properties
11+ widgetId: model.widgetId
12+ widgetType: model.type
13+ widgetData: model.properties
14 isCurrentPreview: root.isCurrentPreview
15 scopeStyle: root.scopeStyle
16 anchors {
17
18=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml'
19--- tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml 2014-07-30 14:16:03 +0000
20+++ tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml 2014-08-21 11:25:15 +0000
21@@ -30,15 +30,21 @@
22 property string longText2: "This is a very very very long text. 1 This is a very very very long text. 2 This is a very very very long text. 3 This is a very very very long text. 4 This is a very very very long text. 5 This is a very very very long text. 6 This is a very very very long text. 7 This is a very very very long text. 8 This is a very very very long text. 9 This is a very very very long text. 10 This is a very very very long text. 11 This is a very very very long text."
23 property string shortText: "This is a short text :)"
24
25+ ListModel {
26+ id: widgetsModel
27+ }
28+
29 property var widgetData: {
30 "title": "Title here",
31 "collapsed-widgets": 2,
32- "widgets": [
33- { "type": "text", "widgetId" : "text1", "properties" : { "text": longText } },
34- { "type": "text", "widgetId" : "text2", "properties" : { "text": longText2 } },
35- { "type": "text", "widgetId" : "text3", "properties" : { "text": shortText } },
36- { "type": "text", "widgetId" : "text4", "properties" : { "text": longText } }
37- ]
38+ "widgets": widgetsModel
39+ }
40+
41+ Component.onCompleted: {
42+ widgetsModel.append({"type": "text", "widgetId": "text1", "properties": { "text": longText }});
43+ widgetsModel.append({"type": "text", "widgetId": "text2", "properties": { "text": longText2 }});
44+ widgetsModel.append({"type": "text", "widgetId": "text3", "properties": { "text": shortText }});
45+ widgetsModel.append({"type": "text", "widgetId": "text4", "properties": { "text": longText }});
46 }
47
48 PreviewExpandable {

Subscribers

People subscribed via source and target branches