Merge lp:~renatofilho/address-book-app/fix-search-crash into lp:~phablet-team/address-book-app/staging

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 215
Merged at revision: 214
Proposed branch: lp:~renatofilho/address-book-app/fix-search-crash
Merge into: lp:~phablet-team/address-book-app/staging
Prerequisite: lp:~renatofilho/address-book-app/new-avatar-empty-icon-on-edit-mode
Diff against target: 103 lines (+34/-30)
2 files modified
click/manifest.json.in (+1/-1)
src/imports/Ubuntu/Contacts/ContactListView.qml (+33/-29)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-search-crash
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Tiago Salem Herrmann (community) Approve
Review via email: mp+226213@code.launchpad.net

Commit message

Fixed app crash wen starting the searching from favorite mode.

To post a comment you must log in.
215. By Renato Araujo Oliveira Filho

Clear the model for every new search.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:214
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/219/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1774
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1490
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/219
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/219
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/219/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/219
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2034
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2838
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2838/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9569
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1247
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1673
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1673/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/219/rebuild

review: Approve (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

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

Is your branch in sync with latest trunk? YES

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator? YES

Did you successfully run all tests found in your component's Test Plan on device or emulator? YES

If you changed the UI, was the change specified/approved by design? NO UI CHANGE

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP? NO PACKAGE CHANGE

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
Yes

Did CI run pass? If not, please explain why.
Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:215
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/220/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1777
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1493
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/220
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/220
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/220/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/220
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2038
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2844
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2844/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9575
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1249
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1678
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1678/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/220/rebuild

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
1=== modified file 'click/manifest.json.in'
2--- click/manifest.json.in 2014-07-07 19:46:23 +0000
3+++ click/manifest.json.in 2014-07-09 22:25:14 +0000
4@@ -18,4 +18,4 @@
5 "vcs-bzr": "lp:address-book-app",
6 "vcs-bzr-revno": "@BZR_REVNO@"
7 }
8-}
9+}
10\ No newline at end of file
11
12=== modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml'
13--- src/imports/Ubuntu/Contacts/ContactListView.qml 2014-07-03 19:35:30 +0000
14+++ src/imports/Ubuntu/Contacts/ContactListView.qml 2014-07-09 22:25:14 +0000
15@@ -373,6 +373,14 @@
16 return tag
17 }
18
19+ // if the favorite header became invisible we should move back to all contacts.
20+ onShowFavouritesChanged: {
21+ if (!showFavourites && view.favouritesIsSelected) {
22+ root.changeFilter(root.filter)
23+ view.favouritesIsSelected = false
24+ }
25+ }
26+
27 anchors {
28 top: itemHeader.bottom
29 left: parent.left
30@@ -523,22 +531,31 @@
31 IntersectionFilter {
32 id: contactsFilter
33
34- property bool active: false
35-
36- filters: {
37- var filters = []
38+ property bool active: {
39+ var filters_ = []
40 if (contactTermFilter.value.length > 0) {
41- filters.push(contactTermFilter)
42- } else if (view.showFavourites && view.favouritesIsSelected) {
43- filters.push(favouritesFilter)
44+ filters_.push(contactTermFilter)
45+ } else if (view.favouritesIsSelected) {
46+ filters_.push(favouritesFilter)
47 }
48
49 if (root.filter) {
50- filters.push(root.filter)
51- }
52-
53- active = (filters.length > 0)
54- return filters
55+ filters_.push(root.filter)
56+ }
57+
58+ // check if the filter has changed
59+ var oldFilters = contactsFilter.filters
60+ if (oldFilters.length !== filters_.length) {
61+ contactsFilter.filters = filters_
62+ } else {
63+ for(var i=0; i < oldFilters.length; i++) {
64+ if (filters_.indexOf(oldFilters[i]) === -1) {
65+ contactsFilter.filters = filters_
66+ }
67+ }
68+ }
69+
70+ return (filters_.length > 0)
71 }
72 }
73
74@@ -550,25 +567,12 @@
75 interval: 300
76 onTriggered: {
77 view.positionViewAtBeginning()
78- var needUpdate = false
79- if (root.filterTerm === "") { // if the search criteria is empty clear the list before show all contacts
80- if (contactTermFilter.value !== "") {
81- root.changeFilter(root.filter)
82- contactTermFilter.value = ""
83- needUpdate = true
84- }
85- } else {
86- if (contactTermFilter.value !== root.filterTerm) {
87- if (contactTermFilter.value === "") { // if the search starts clear the list before show results
88- root.changeFilter(root.filter)
89- }
90- contactTermFilter.value = root.filterTerm
91- needUpdate = true
92- }
93- }
94+
95+ root.changeFilter(root.filter)
96+ contactTermFilter.value = root.filterTerm
97
98 // manually update if autoUpdate is disabled
99- if (needUpdate && !root.autoUpdate) {
100+ if (!root.autoUpdate) {
101 contactsModel.update()
102 }
103 }

Subscribers

People subscribed via source and target branches