Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/insensitivePattern into lp:ubuntu-ui-toolkit/staging

Proposed by Cris Dywan
Status: Merged
Merged at revision: 2174
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/insensitivePattern
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 85 lines (+19/-5)
2 files modified
src/UbuntuToolkit/sortfiltermodel.cpp (+5/-2)
tests/unit/components/tst_sortfiltermodel.qml (+14/-3)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/insensitivePattern
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Needs Fixing
Tim Peeters Approve
Adnane Belmadiaf (community) Approve
Review via email: mp+317537@code.launchpad.net

Commit message

Unit test case insensitive FilterBehavior.pattern

To post a comment you must log in.
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
Adnane Belmadiaf (daker) wrote :

LGMT

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)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

looks good.

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)
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)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/UbuntuToolkit/sortfiltermodel.cpp'
--- src/UbuntuToolkit/sortfiltermodel.cpp 2016-09-12 09:03:50 +0000
+++ src/UbuntuToolkit/sortfiltermodel.cpp 2017-02-21 10:56:46 +0000
@@ -52,7 +52,8 @@
52 * }52 * }
53 * ListElement {53 * ListElement {
54 * title: "Elephants Dream"54 * title: "Elephants Dream"
55 * producer: "Blender"55 * // lowercase b
56 * producer: "blender"
56 * }57 * }
57 * ListElement {58 * ListElement {
58 * title: "Big Buck Bunny"59 * title: "Big Buck Bunny"
@@ -69,7 +70,8 @@
69 * sortCaseSensitivity: Qt.CaseInsensitive70 * sortCaseSensitivity: Qt.CaseInsensitive
70 *71 *
71 * filter.property: "producer"72 * filter.property: "producer"
72 * filter.pattern: /blender/73 * // case insensitive matches
74 * filter.pattern: /blender/i
73 * }75 * }
74 *76 *
75 * ListView {77 * ListView {
@@ -154,6 +156,7 @@
154 * \li /possible/ matches anywhere in a word, so both "impossible" and "possible".156 * \li /possible/ matches anywhere in a word, so both "impossible" and "possible".
155 * \li /^sign/ matches "sign". But not "assignment" because ^ means start.157 * \li /^sign/ matches "sign". But not "assignment" because ^ means start.
156 * \li /vest$/ matches "safety vest" and "vest" but not "vested".158 * \li /vest$/ matches "safety vest" and "vest" but not "vested".
159 * \li /bar/i matches "bar", "Bar" or "BAR" regardless of case.
157 * \endlist160 * \endlist
158 *161 *
159 * For more advanced uses it's recommended to read up on Javascript regular expressions.162 * For more advanced uses it's recommended to read up on Javascript regular expressions.
160163
=== modified file 'tests/unit/components/tst_sortfiltermodel.qml'
--- tests/unit/components/tst_sortfiltermodel.qml 2015-03-03 13:20:06 +0000
+++ tests/unit/components/tst_sortfiltermodel.qml 2017-02-21 10:56:46 +0000
@@ -25,7 +25,7 @@
25 id: things25 id: things
26 ListElement { foo: "pub"; alpha: "bee"; num: 200 }26 ListElement { foo: "pub"; alpha: "bee"; num: 200 }
27 ListElement { foo: "den"; alpha: "cow"; num: 300 }27 ListElement { foo: "den"; alpha: "cow"; num: 300 }
28 ListElement { foo: "bar"; alpha: "ant"; num: 100 }28 ListElement { foo: "Bar"; alpha: "ant"; num: 100 }
29 }29 }
3030
31 SortFilterModel {31 SortFilterModel {
@@ -72,6 +72,13 @@
72 filter.pattern: /e/72 filter.pattern: /e/
73 }73 }
7474
75 SortFilterModel {
76 id: caseSensitivity
77 model: things
78 filter.property: "foo"
79 filter.pattern: /bar/i
80 }
81
75 function test_passthrough() {82 function test_passthrough() {
76 compare(unmodified.count, things.count)83 compare(unmodified.count, things.count)
77 }84 }
@@ -84,7 +91,7 @@
84 compare(alphabetic.get(2).alpha, "cow")91 compare(alphabetic.get(2).alpha, "cow")
8592
86 // Ensure different columns work also93 // Ensure different columns work also
87 compare(alphaSecond.get(0).foo, "bar")94 compare(alphaSecond.get(0).foo, "Bar")
8895
89 // Descending96 // Descending
90 compare(alphabeticRe.sort.order, Qt.DescendingOrder)97 compare(alphabeticRe.sort.order, Qt.DescendingOrder)
@@ -98,7 +105,7 @@
98105
99 // Changing roles106 // Changing roles
100 alphabetic.sort.property = "foo"107 alphabetic.sort.property = "foo"
101 compare(alphabetic.get(0).foo, "bar")108 compare(alphabetic.get(0).foo, "Bar")
102 compare(alphabetic.get(1).foo, "den")109 compare(alphabetic.get(1).foo, "den")
103 compare(alphabetic.get(2).foo, "pub")110 compare(alphabetic.get(2).foo, "pub")
104 // Sanity check111 // Sanity check
@@ -120,4 +127,8 @@
120 compare(bee.count, 1)127 compare(bee.count, 1)
121 compare(bee.get(0).alpha, "bee")128 compare(bee.get(0).alpha, "bee")
122 }129 }
130
131 function test_case_sensitivity() {
132 compare(caseSensitivity.get(0).foo, "Bar")
133 }
123}134}

Subscribers

People subscribed via source and target branches