Merge lp:~mzanetti/reminders-app/fix-count-when-sorting into lp:reminders-app

Proposed by Michael Zanetti
Status: Merged
Approved by: Riccardo Padovani
Approved revision: 451
Merged at revision: 452
Proposed branch: lp:~mzanetti/reminders-app/fix-count-when-sorting
Merge into: lp:reminders-app
Diff against target: 60 lines (+20/-16)
1 file modified
src/app/qml/ui/NotesPage.qml (+20/-16)
To merge this branch: bzr merge lp:~mzanetti/reminders-app/fix-count-when-sorting
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Riccardo Padovani Approve
Review via email: mp+261785@code.launchpad.net

Commit message

fix section count when sorting by something else than created date

To post a comment you must log in.
Revision history for this message
Riccardo Padovani (rpadovani) wrote :

lgtm, thanks!

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/app/qml/ui/NotesPage.qml'
--- src/app/qml/ui/NotesPage.qml 2015-04-05 10:56:46 +0000
+++ src/app/qml/ui/NotesPage.qml 2015-06-11 22:03:52 +0000
@@ -141,6 +141,24 @@
141 id: notes141 id: notes
142 }142 }
143143
144 function sortOrderToString(sortOrder){
145 print("asking for sortOrder", sortOrder, Notes.SortOrderDateUpdatedNewest)
146 switch(sortOrder) {
147 case Notes.SortOrderDateCreatedNewest:
148 case Notes.SortOrderDateCreatedOldest:
149 print("returning createdString")
150 return "createdString";
151 case Notes.SortOrderDateUpdatedNewest:
152 case Notes.SortOrderDateUpdatedOldest:
153 print("returning updatedString")
154 return "updatedString";
155 case Notes.SortOrderTitleAscending:
156 case Notes.SortOrderTitleDescending:
157 return "title";
158 }
159 return "";
160 }
161
144 PulldownListView {162 PulldownListView {
145 id: notesListView163 id: notesListView
146 objectName: "notespageListview"164 objectName: "notespageListview"
@@ -210,21 +228,7 @@
210228
211 return ViewSection.FullString229 return ViewSection.FullString
212 }230 }
213 section.property: {231 section.property: root.sortOrderToString(notes.sortOrder);
214 switch(notes.sortOrder) {
215 case Notes.SortOrderDateCreatedNewest:
216 case Notes.SortOrderDateCreatedOldest:
217 return "createdString";
218 case Notes.SortOrderDateUpdatedNewest:
219 case Notes.SortOrderDateUpdatedOldest:
220 return "updatedString";
221 case Notes.SortOrderTitleAscending:
222 case Notes.SortOrderTitleDescending:
223 return "title";
224 }
225 return "";
226 }
227
228232
229 section.delegate: Empty {233 section.delegate: Empty {
230 height: units.gu(5)234 height: units.gu(5)
@@ -236,7 +240,7 @@
236 Layout.fillWidth: true240 Layout.fillWidth: true
237 }241 }
238 Label {242 Label {
239 text: "(" + notes.sectionCount("createdString", section) + ")"243 text: "(" + notes.sectionCount(root.sortOrderToString(notes.sortOrder), section) + ")"
240 }244 }
241 }245 }
242 }246 }

Subscribers

People subscribed via source and target branches