Merge lp:~ahayzen/music-app/fix-columnflow-reset-tab-change into lp:music-app/remix

Proposed by Andrew Hayzen
Status: Merged
Approved by: Victor Thompson
Approved revision: 779
Merged at revision: 777
Proposed branch: lp:~ahayzen/music-app/fix-columnflow-reset-tab-change
Merge into: lp:music-app/remix
Diff against target: 51 lines (+8/-10)
2 files modified
common/ColumnFlow.qml (+0/-5)
common/SearchHeadState.qml (+8/-5)
To merge this branch: bzr merge lp:~ahayzen/music-app/fix-columnflow-reset-tab-change
Reviewer Review Type Date Requested Status
Victor Thompson Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+246066@code.launchpad.net

Commit message

* Fix the ColumnFlow.qml so that it does not reset on tab change
* Ensure search is reset on state change

Description of the change

* Fix the ColumnFlow.qml so that it does not reset on tab change
* Ensure search is reset on state change

Extra code that was added when debugging and now not needed.

To post a comment you must log in.
778. By Andrew Hayzen

* Ensure search is reset on state change

779. By Andrew Hayzen

* Simplify the logic

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'common/ColumnFlow.qml'
2--- common/ColumnFlow.qml 2015-01-11 15:54:04 +0000
3+++ common/ColumnFlow.qml 2015-01-11 17:55:18 +0000
4@@ -61,11 +61,6 @@
5 }
6 }
7
8- onModelChanged: { // reload the model when it is set
9- reset()
10- append(true, model.count - 1)
11- }
12-
13 onVisibleChanged: {
14 if (visible && delayRebuildIndex !== -1) { // restore from count change
15 if (delayRebuildIndex === 0) {
16
17=== modified file 'common/SearchHeadState.qml'
18--- common/SearchHeadState.qml 2015-01-11 15:54:04 +0000
19+++ common/SearchHeadState.qml 2015-01-11 17:55:18 +0000
20@@ -27,10 +27,7 @@
21 id: leaveSearchAction
22 text: "back"
23 iconName: "back"
24- onTriggered: {
25- thisPage.state = "default"
26- searchField.text = ""
27- }
28+ onTriggered: thisPage.state = "default"
29 }
30 contents: TextField {
31 id: searchField
32@@ -54,12 +51,18 @@
33 // This is used when popping from the pageStack and returning back to a page with search
34 Connections {
35 target: thisPage
36+
37+ onStateChanged: { // ensure the search is reset (eg pressing Esc)
38+ if (state === "default") {
39+ searchField.text = ""
40+ }
41+ }
42+
43 onVisibleChanged: {
44 // clear when the page becomes visible not invisible
45 // if invisible is used the delegates can be destroyed which
46 // have created the pushed component
47 if (visible) {
48- searchField.text = ""
49 thisPage.state = "default"
50 }
51 }

Subscribers

People subscribed via source and target branches