ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #02708
[Merge] lp:~mzanetti/reminders-app/fix-count-when-sorting into lp:reminders-app
Michael Zanetti has proposed merging lp:~mzanetti/reminders-app/fix-count-when-sorting into lp:reminders-app.
Commit message:
fix section count when sorting by something else than created date
Requested reviews:
Ubuntu Reminders app developers (reminders-app-dev)
For more details, see:
https://code.launchpad.net/~mzanetti/reminders-app/fix-count-when-sorting/+merge/261785
--
Your team Ubuntu Reminders app developers is requested to review the proposed merge of lp:~mzanetti/reminders-app/fix-count-when-sorting into lp:reminders-app.
=== 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 @@
id: notes
}
+ function sortOrderToString(sortOrder){
+ print("asking for sortOrder", sortOrder, Notes.SortOrderDateUpdatedNewest)
+ switch(sortOrder) {
+ case Notes.SortOrderDateCreatedNewest:
+ case Notes.SortOrderDateCreatedOldest:
+ print("returning createdString")
+ return "createdString";
+ case Notes.SortOrderDateUpdatedNewest:
+ case Notes.SortOrderDateUpdatedOldest:
+ print("returning updatedString")
+ return "updatedString";
+ case Notes.SortOrderTitleAscending:
+ case Notes.SortOrderTitleDescending:
+ return "title";
+ }
+ return "";
+ }
+
PulldownListView {
id: notesListView
objectName: "notespageListview"
@@ -210,21 +228,7 @@
return ViewSection.FullString
}
- section.property: {
- switch(notes.sortOrder) {
- case Notes.SortOrderDateCreatedNewest:
- case Notes.SortOrderDateCreatedOldest:
- return "createdString";
- case Notes.SortOrderDateUpdatedNewest:
- case Notes.SortOrderDateUpdatedOldest:
- return "updatedString";
- case Notes.SortOrderTitleAscending:
- case Notes.SortOrderTitleDescending:
- return "title";
- }
- return "";
- }
-
+ section.property: root.sortOrderToString(notes.sortOrder);
section.delegate: Empty {
height: units.gu(5)
@@ -236,7 +240,7 @@
Layout.fillWidth: true
}
Label {
- text: "(" + notes.sectionCount("createdString", section) + ")"
+ text: "(" + notes.sectionCount(root.sortOrderToString(notes.sortOrder), section) + ")"
}
}
}
Follow ups