Merge lp:~daker/ubuntu-ui-toolkit/fix.1341559 into lp:ubuntu-ui-toolkit/staging

Proposed by Adnane Belmadiaf
Status: Merged
Approved by: Cris Dywan
Approved revision: 2177
Merged at revision: 2175
Proposed branch: lp:~daker/ubuntu-ui-toolkit/fix.1341559
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 50 lines (+16/-0)
3 files modified
components.api (+1/-0)
src/imports/Components/1.3/OptionSelector.qml (+6/-0)
tests/unit/visual/tst_optionselector.13.qml (+9/-0)
To merge this branch: bzr merge lp:~daker/ubuntu-ui-toolkit/fix.1341559
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+317568@code.launchpad.net

Commit message

Add count prop to OptionSelector

Description of the change

Add count prop to OptionSelector

To post a comment you must log in.
Revision history for this message
Cris Dywan (kalikiana) wrote :

Can we have a unit test in tests/unit/visual/tst_optionselector.13.qml verifying that the count is correct?

review: Needs Fixing
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: Needs Fixing (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: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
2175. By Adnane Belmadiaf

Fix components.api

2176. By Adnane Belmadiaf

Add test for the OptionSelector count prop

Revision history for this message
Cris Dywan (kalikiana) wrote :

Looks good! Let's see if Jenkins agrees.

review: Approve
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: Needs Fixing (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: Needs Fixing (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
Cris Dywan (kalikiana) wrote :

@@ -731,6 +731,7 @@ Ubuntu.Components.OptionSelector 1.0 0.1
 Ubuntu.Components.OptionSelector 1.3: Empty
     property bool colourImage
     property double containerHeight
+ readonly property int count
     property bool currentlyExpanded
     property Component delegate
     property bool expanded
@@ -740,7 +741,6 @@ Ubuntu.Components.OptionSelector 1.3: Em
     property var model
     property bool multiSelection
     property int selectedIndex
- readonly property int count
 Ubuntu.Components.OptionSelectorDelegate 1.0 0.1: Empty
     property color assetColour
     property bool colourImage
Differences in API. Did you forget to update components.api?

review: Needs Fixing
2177. By Adnane Belmadiaf

Fix components.api

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
Cris Dywan (kalikiana) wrote :

Sweet! Thanks for fixing!

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: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2017-01-26 11:59:45 +0000
+++ components.api 2017-02-21 14:57:14 +0000
@@ -731,6 +731,7 @@
731Ubuntu.Components.OptionSelector 1.3: Empty731Ubuntu.Components.OptionSelector 1.3: Empty
732 property bool colourImage732 property bool colourImage
733 property double containerHeight733 property double containerHeight
734 readonly property int count
734 property bool currentlyExpanded735 property bool currentlyExpanded
735 property Component delegate736 property Component delegate
736 property bool expanded737 property bool expanded
737738
=== modified file 'src/imports/Components/1.3/OptionSelector.qml'
--- src/imports/Components/1.3/OptionSelector.qml 2016-08-22 10:18:57 +0000
+++ src/imports/Components/1.3/OptionSelector.qml 2017-02-21 14:57:14 +0000
@@ -155,6 +155,12 @@
155 }155 }
156156
157 /*!157 /*!
158 \qmlproperty int count
159 This property holds the number of items in the OptionSelector.
160 */
161 property alias count: list.count
162
163 /*!
158 \qmlproperty int selectedIndex164 \qmlproperty int selectedIndex
159 The index of the currently selected element in our list.165 The index of the currently selected element in our list.
160 */166 */
161167
=== modified file 'tests/unit/visual/tst_optionselector.13.qml'
--- tests/unit/visual/tst_optionselector.13.qml 2016-09-19 11:13:19 +0000
+++ tests/unit/visual/tst_optionselector.13.qml 2017-02-21 14:57:14 +0000
@@ -183,8 +183,17 @@
183 function test_custom_data() {183 function test_custom_data() {
184 return test_arrow_select_data()184 return test_arrow_select_data()
185 }185 }
186
186 function test_custom(data) {187 function test_custom(data) {
187 test_arrow_select(data, customSelector, 2);188 test_arrow_select(data, customSelector, 2);
188 }189 }
190
191 function test_count() {
192 var selector = defaultSelector;
193 sections.selectedIndex = 0;
194 selector.forceActiveFocus();
195 waitForRendering(selector);
196 compare(selector.count, customModel.count);
197 }
189 }198 }
190}199}

Subscribers

People subscribed via source and target branches