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
1=== modified file 'src/app/qml/ui/NotesPage.qml'
2--- src/app/qml/ui/NotesPage.qml 2015-04-05 10:56:46 +0000
3+++ src/app/qml/ui/NotesPage.qml 2015-06-11 22:03:52 +0000
4@@ -141,6 +141,24 @@
5 id: notes
6 }
7
8+ function sortOrderToString(sortOrder){
9+ print("asking for sortOrder", sortOrder, Notes.SortOrderDateUpdatedNewest)
10+ switch(sortOrder) {
11+ case Notes.SortOrderDateCreatedNewest:
12+ case Notes.SortOrderDateCreatedOldest:
13+ print("returning createdString")
14+ return "createdString";
15+ case Notes.SortOrderDateUpdatedNewest:
16+ case Notes.SortOrderDateUpdatedOldest:
17+ print("returning updatedString")
18+ return "updatedString";
19+ case Notes.SortOrderTitleAscending:
20+ case Notes.SortOrderTitleDescending:
21+ return "title";
22+ }
23+ return "";
24+ }
25+
26 PulldownListView {
27 id: notesListView
28 objectName: "notespageListview"
29@@ -210,21 +228,7 @@
30
31 return ViewSection.FullString
32 }
33- section.property: {
34- switch(notes.sortOrder) {
35- case Notes.SortOrderDateCreatedNewest:
36- case Notes.SortOrderDateCreatedOldest:
37- return "createdString";
38- case Notes.SortOrderDateUpdatedNewest:
39- case Notes.SortOrderDateUpdatedOldest:
40- return "updatedString";
41- case Notes.SortOrderTitleAscending:
42- case Notes.SortOrderTitleDescending:
43- return "title";
44- }
45- return "";
46- }
47-
48+ section.property: root.sortOrderToString(notes.sortOrder);
49
50 section.delegate: Empty {
51 height: units.gu(5)
52@@ -236,7 +240,7 @@
53 Layout.fillWidth: true
54 }
55 Label {
56- text: "(" + notes.sectionCount("createdString", section) + ")"
57+ text: "(" + notes.sectionCount(root.sortOrderToString(notes.sortOrder), section) + ")"
58 }
59 }
60 }

Subscribers

People subscribed via source and target branches