Merge lp:~mzanetti/reminders-app/sort-order into lp:reminders-app
- sort-order
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Alan Pope πΊπ§π± π¦ | ||||
Approved revision: | 344 | ||||
Merged at revision: | 345 | ||||
Proposed branch: | lp:~mzanetti/reminders-app/sort-order | ||||
Merge into: | lp:reminders-app | ||||
Diff against target: |
367 lines (+230/-8) 7 files modified
src/app/qml/components/NotesDelegate.qml (+2/-5) src/app/qml/components/SortingDialog.qml (+49/-0) src/app/qml/images/sorting.svg (+95/-0) src/app/qml/ui/NotesPage.qml (+24/-2) src/libqtevernote/notes.cpp (+43/-1) src/libqtevernote/notes.h (+16/-0) src/libqtevernote/notesstore.cpp (+1/-0) |
||||
To merge this branch: | bzr merge lp:~mzanetti/reminders-app/sort-order | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Riccardo Padovani | Approve | ||
Review via email: mp+249576@code.launchpad.net |
Commit message
add sort order header action
Description of the change
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Riccardo Padovani (rpadovani) wrote : | # |
IMO the preference about the sort order has to be saved, so at every start users haven't to change the sort order again
Michael Zanetti (mzanetti) wrote : | # |
> IMO the preference about the sort order has to be saved, so at every start
> users haven't to change the sort order again
fixed. thanks
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:342
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Riccardo Padovani (rpadovani) wrote : | # |
lgtm now, thanks
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:342
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 343. By Michael Zanetti
-
try shuffling the order
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:343
http://
Executed test runs:
UNSTABLE: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 344. By Michael Zanetti
-
really don't know why jenkins wouldn't allow me to import Popups from NotesPage.qml
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:344
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'src/app/qml/components/NotesDelegate.qml' | |||
2 | --- src/app/qml/components/NotesDelegate.qml 2015-02-12 23:47:43 +0000 | |||
3 | +++ src/app/qml/components/NotesDelegate.qml 2015-02-21 14:13:56 +0000 | |||
4 | @@ -28,8 +28,7 @@ | |||
5 | 28 | width: parent.width | 28 | width: parent.width |
6 | 29 | 29 | ||
7 | 30 | property string title | 30 | property string title |
10 | 31 | property date creationDate | 31 | property string date |
9 | 32 | property date changedDate | ||
11 | 33 | property string content | 32 | property string content |
12 | 34 | property string resource | 33 | property string resource |
13 | 35 | property string tags | 34 | property string tags |
14 | @@ -124,10 +123,8 @@ | |||
15 | 124 | Label { | 123 | Label { |
16 | 125 | Layout.fillWidth: true | 124 | Layout.fillWidth: true |
17 | 126 | Layout.fillHeight: true | 125 | Layout.fillHeight: true |
18 | 127 | // TRANSLATORS: the argument is a modification date that follows this format: | ||
19 | 128 | // http://qt-project.org/doc/qt-5/qml-qtqml-date.html | ||
20 | 129 | text: "<font color=\"" + root.notebookColor + "\">" + | 126 | text: "<font color=\"" + root.notebookColor + "\">" + |
22 | 130 | Qt.formatDateTime(root.creationDate, i18n.tr("yyyy/mm/dd hh:mm")) + | 127 | Qt.formatDateTime(root.date, Qt.LocalDate) + |
23 | 131 | " </font>" + root.content | 128 | " </font>" + root.content |
24 | 132 | wrapMode: Text.WordWrap | 129 | wrapMode: Text.WordWrap |
25 | 133 | textFormat: Text.StyledText | 130 | textFormat: Text.StyledText |
26 | 134 | 131 | ||
27 | === added file 'src/app/qml/components/SortingDialog.qml' | |||
28 | --- src/app/qml/components/SortingDialog.qml 1970-01-01 00:00:00 +0000 | |||
29 | +++ src/app/qml/components/SortingDialog.qml 2015-02-21 14:13:56 +0000 | |||
30 | @@ -0,0 +1,49 @@ | |||
31 | 1 | import QtQuick 2.2 | ||
32 | 2 | import Ubuntu.Components 1.0 | ||
33 | 3 | import Ubuntu.Components.Popups 1.0 | ||
34 | 4 | import Ubuntu.Components.ListItems 1.0 | ||
35 | 5 | import reminders 1.0 | ||
36 | 6 | |||
37 | 7 | Item { | ||
38 | 8 | id: root | ||
39 | 9 | |||
40 | 10 | property int sortOrder | ||
41 | 11 | |||
42 | 12 | signal accepted(); | ||
43 | 13 | |||
44 | 14 | Component.onCompleted: PopupUtils.open(dialogComponent, root, {sortOrder: root.sortOrder}) | ||
45 | 15 | |||
46 | 16 | Component { | ||
47 | 17 | id: dialogComponent | ||
48 | 18 | Dialog { | ||
49 | 19 | id: dialog | ||
50 | 20 | title: i18n.tr("Sort by") | ||
51 | 21 | |||
52 | 22 | property alias sortOrder: optionSelector.selectedIndex | ||
53 | 23 | |||
54 | 24 | |||
55 | 25 | OptionSelector { | ||
56 | 26 | id: optionSelector | ||
57 | 27 | expanded: true | ||
58 | 28 | model: [ | ||
59 | 29 | i18n.tr("Date created (newest first)"), | ||
60 | 30 | i18n.tr("Date created (oldest first)"), | ||
61 | 31 | i18n.tr("Date updated (newest first)"), | ||
62 | 32 | i18n.tr("Date updated (oldest first)"), | ||
63 | 33 | i18n.tr("Title (ascending)"), | ||
64 | 34 | i18n.tr("Title (descending)") | ||
65 | 35 | ] | ||
66 | 36 | } | ||
67 | 37 | |||
68 | 38 | Button { | ||
69 | 39 | text: i18n.tr("Close") | ||
70 | 40 | onClicked: { | ||
71 | 41 | root.sortOrder = optionSelector.selectedIndex | ||
72 | 42 | root.accepted(); | ||
73 | 43 | PopupUtils.close(dialog); | ||
74 | 44 | } | ||
75 | 45 | } | ||
76 | 46 | } | ||
77 | 47 | } | ||
78 | 48 | } | ||
79 | 49 | |||
80 | 0 | 50 | ||
81 | === added file 'src/app/qml/images/sorting.svg' | |||
82 | --- src/app/qml/images/sorting.svg 1970-01-01 00:00:00 +0000 | |||
83 | +++ src/app/qml/images/sorting.svg 2015-02-21 14:13:56 +0000 | |||
84 | @@ -0,0 +1,95 @@ | |||
85 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
86 | 2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
87 | 3 | |||
88 | 4 | <svg | ||
89 | 5 | xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
90 | 6 | xmlns:cc="http://creativecommons.org/ns#" | ||
91 | 7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
92 | 8 | xmlns:svg="http://www.w3.org/2000/svg" | ||
93 | 9 | xmlns="http://www.w3.org/2000/svg" | ||
94 | 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
95 | 11 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
96 | 12 | id="svg4874" | ||
97 | 13 | height="90" | ||
98 | 14 | viewBox="0 0 90 90.000001" | ||
99 | 15 | width="90" | ||
100 | 16 | version="1.1" | ||
101 | 17 | inkscape:version="0.48.5 r10040" | ||
102 | 18 | sodipodi:docname="user-switch.svg"> | ||
103 | 19 | <defs | ||
104 | 20 | id="defs14" /> | ||
105 | 21 | <sodipodi:namedview | ||
106 | 22 | pagecolor="#ffffff" | ||
107 | 23 | bordercolor="#666666" | ||
108 | 24 | borderopacity="1" | ||
109 | 25 | objecttolerance="10" | ||
110 | 26 | gridtolerance="10" | ||
111 | 27 | guidetolerance="10" | ||
112 | 28 | inkscape:pageopacity="0" | ||
113 | 29 | inkscape:pageshadow="2" | ||
114 | 30 | inkscape:window-width="2880" | ||
115 | 31 | inkscape:window-height="1752" | ||
116 | 32 | id="namedview12" | ||
117 | 33 | showgrid="false" | ||
118 | 34 | inkscape:zoom="2.6222222" | ||
119 | 35 | inkscape:cx="45" | ||
120 | 36 | inkscape:cy="45" | ||
121 | 37 | inkscape:window-x="0" | ||
122 | 38 | inkscape:window-y="48" | ||
123 | 39 | inkscape:window-maximized="1" | ||
124 | 40 | inkscape:current-layer="svg4874" /> | ||
125 | 41 | <metadata | ||
126 | 42 | id="metadata4879"> | ||
127 | 43 | <rdf:RDF> | ||
128 | 44 | <cc:Work | ||
129 | 45 | rdf:about=""> | ||
130 | 46 | <dc:format>image/svg+xml</dc:format> | ||
131 | 47 | <dc:type | ||
132 | 48 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||
133 | 49 | <dc:title /> | ||
134 | 50 | </cc:Work> | ||
135 | 51 | </rdf:RDF> | ||
136 | 52 | </metadata> | ||
137 | 53 | <g | ||
138 | 54 | id="layer1" | ||
139 | 55 | transform="matrix(0,1,-1,0,174.505,67.856999)"> | ||
140 | 56 | <g | ||
141 | 57 | id="g4115"> | ||
142 | 58 | <rect | ||
143 | 59 | id="rect4198-7" | ||
144 | 60 | style="color:#000000;fill:none" | ||
145 | 61 | height="90" | ||
146 | 62 | width="90" | ||
147 | 63 | y="84.504997" | ||
148 | 64 | x="-67.857002" /> | ||
149 | 65 | <rect | ||
150 | 66 | id="rect3049" | ||
151 | 67 | style="color:#000000;fill:none" | ||
152 | 68 | transform="scale(-1,1)" | ||
153 | 69 | height="90" | ||
154 | 70 | width="90" | ||
155 | 71 | y="84.504997" | ||
156 | 72 | x="-22.143" /> | ||
157 | 73 | <path | ||
158 | 74 | id="rect3765" | ||
159 | 75 | style="color:#000000;fill:#808080" | ||
160 | 76 | d="m -33.857,152.51 h 36 l 9.2e-6,-9 -36.0000002,1e-5 z" | ||
161 | 77 | inkscape:connector-curvature="0" /> | ||
162 | 78 | <path | ||
163 | 79 | id="path4130" | ||
164 | 80 | style="color:#000000;fill:#808080" | ||
165 | 81 | d="m -30.717,162.59 c 0,0 -13.63,-5.962 -25.549,-14.552 0,-0.002 0,-0.004 0.0051,-0.009 0,-0.002 0.0051,-0.007 0.006,-0.01 0,-0.002 0.0051,-0.007 0.006,-0.01 0,-0.002 0.0051,-0.007 0.0051,-0.01 12.573,-8.8638 25.532,-14.498 25.532,-14.498 z" | ||
166 | 82 | inkscape:connector-curvature="0" /> | ||
167 | 83 | <path | ||
168 | 84 | id="path4118" | ||
169 | 85 | style="color:#000000;fill:#808080" | ||
170 | 86 | d="m -11.857,115.51 h -36 l -9e-6,-9 36,10e-6 z" | ||
171 | 87 | inkscape:connector-curvature="0" /> | ||
172 | 88 | <path | ||
173 | 89 | id="path4120" | ||
174 | 90 | style="color:#000000;fill:#808080" | ||
175 | 91 | d="m -14.998,125.59 c 0,0 13.63,-5.962 25.549,-14.552 0,-0.002 0,-0.004 -0.0051,-0.009 0,-0.002 -0.0051,-0.007 -0.006,-0.01 0,-0.002 -0.0051,-0.007 -0.006,-0.01 0,-0.002 -0.0051,-0.007 -0.0051,-0.01 -12.573,-8.8638 -25.532,-14.498 -25.532,-14.498 z" | ||
176 | 92 | inkscape:connector-curvature="0" /> | ||
177 | 93 | </g> | ||
178 | 94 | </g> | ||
179 | 95 | </svg> | ||
180 | 0 | 96 | ||
181 | === modified file 'src/app/qml/ui/NotesPage.qml' | |||
182 | --- src/app/qml/ui/NotesPage.qml 2015-02-12 23:47:43 +0000 | |||
183 | +++ src/app/qml/ui/NotesPage.qml 2015-02-21 14:13:56 +0000 | |||
184 | @@ -23,6 +23,7 @@ | |||
185 | 23 | import Ubuntu.Components.Popups 1.0 | 23 | import Ubuntu.Components.Popups 1.0 |
186 | 24 | import Evernote 0.1 | 24 | import Evernote 0.1 |
187 | 25 | import "../components" | 25 | import "../components" |
188 | 26 | import Qt.labs.settings 1.0 | ||
189 | 26 | 27 | ||
190 | 27 | PageWithBottomEdge { | 28 | PageWithBottomEdge { |
191 | 28 | id: root | 29 | id: root |
192 | @@ -80,6 +81,22 @@ | |||
193 | 80 | 81 | ||
194 | 81 | ToolbarButton { | 82 | ToolbarButton { |
195 | 82 | action: Action { | 83 | action: Action { |
196 | 84 | iconSource: "../images/sorting.svg" | ||
197 | 85 | text: i18n.tr("Sorting") | ||
198 | 86 | onTriggered: { | ||
199 | 87 | var popupComponent = Qt.createComponent(Qt.resolvedUrl("../components/SortingDialog.qml")); | ||
200 | 88 | var popup = popupComponent.createObject(root, {sortOrder: notes.sortOrder} ) | ||
201 | 89 | popup.accepted.connect( function() { | ||
202 | 90 | notes.sortOrder = popup.sortOrder | ||
203 | 91 | popup.destroy(); | ||
204 | 92 | }) | ||
205 | 93 | popup.sortOrder = notes.sortOrder; | ||
206 | 94 | } | ||
207 | 95 | } | ||
208 | 96 | } | ||
209 | 97 | |||
210 | 98 | ToolbarButton { | ||
211 | 99 | action: Action { | ||
212 | 83 | text: i18n.tr("Accounts") | 100 | text: i18n.tr("Accounts") |
213 | 84 | iconName: "contacts-app-symbolic" | 101 | iconName: "contacts-app-symbolic" |
214 | 85 | onTriggered: { | 102 | onTriggered: { |
215 | @@ -127,6 +144,10 @@ | |||
216 | 127 | } | 144 | } |
217 | 128 | } | 145 | } |
218 | 129 | 146 | ||
219 | 147 | Settings { | ||
220 | 148 | property alias sortOrder: notes.sortOrder | ||
221 | 149 | } | ||
222 | 150 | |||
223 | 130 | Notes { | 151 | Notes { |
224 | 131 | id: notes | 152 | id: notes |
225 | 132 | } | 153 | } |
226 | @@ -146,8 +167,9 @@ | |||
227 | 146 | 167 | ||
228 | 147 | delegate: NotesDelegate { | 168 | delegate: NotesDelegate { |
229 | 148 | title: model.title | 169 | title: model.title |
232 | 149 | creationDate: model.created | 170 | date: notes.sortOrder == Notes.SortOrderUpdatedOldest || notes.sortOrder == Notes.SortOrderUpdatedNewest ? |
233 | 150 | changedDate: model.updated | 171 | model.updated : model.created |
234 | 172 | |||
235 | 151 | content: model.tagline | 173 | content: model.tagline |
236 | 152 | triggerActionOnMouseRelease: true | 174 | triggerActionOnMouseRelease: true |
237 | 153 | tags: { | 175 | tags: { |
238 | 154 | 176 | ||
239 | === modified file 'src/libqtevernote/notes.cpp' | |||
240 | --- src/libqtevernote/notes.cpp 2014-12-10 22:27:42 +0000 | |||
241 | +++ src/libqtevernote/notes.cpp 2015-02-21 14:13:56 +0000 | |||
242 | @@ -26,7 +26,8 @@ | |||
243 | 26 | Notes::Notes(QObject *parent) : | 26 | Notes::Notes(QObject *parent) : |
244 | 27 | QSortFilterProxyModel(parent), | 27 | QSortFilterProxyModel(parent), |
245 | 28 | m_onlyReminders(false), | 28 | m_onlyReminders(false), |
247 | 29 | m_showDeleted(false) | 29 | m_showDeleted(false), |
248 | 30 | m_sortOrder(SortOrderDateCreatedNewest) | ||
249 | 30 | { | 31 | { |
250 | 31 | connect(NotesStore::instance(), &NotesStore::loadingChanged, this, &Notes::loadingChanged); | 32 | connect(NotesStore::instance(), &NotesStore::loadingChanged, this, &Notes::loadingChanged); |
251 | 32 | connect(NotesStore::instance(), &NotesStore::errorChanged, this, &Notes::errorChanged); | 33 | connect(NotesStore::instance(), &NotesStore::errorChanged, this, &Notes::errorChanged); |
252 | @@ -154,6 +155,47 @@ | |||
253 | 154 | return count; | 155 | return count; |
254 | 155 | } | 156 | } |
255 | 156 | 157 | ||
256 | 158 | Notes::SortOrder Notes::sortOrder() const | ||
257 | 159 | { | ||
258 | 160 | return m_sortOrder; | ||
259 | 161 | } | ||
260 | 162 | |||
261 | 163 | void Notes::setSortOrder(Notes::SortOrder sortOrder) | ||
262 | 164 | { | ||
263 | 165 | if (m_sortOrder != sortOrder) { | ||
264 | 166 | emit layoutAboutToBeChanged(); | ||
265 | 167 | switch (sortOrder) { | ||
266 | 168 | case SortOrderDateCreatedNewest: | ||
267 | 169 | setSortRole(NotesStore::RoleCreated); | ||
268 | 170 | sort(0, Qt::DescendingOrder); | ||
269 | 171 | break; | ||
270 | 172 | case SortOrderDateCreatedOldest: | ||
271 | 173 | setSortRole(NotesStore::RoleCreated); | ||
272 | 174 | sort(0, Qt::AscendingOrder); | ||
273 | 175 | break; | ||
274 | 176 | case SortOrderDateUpdatedNewest: | ||
275 | 177 | setSortRole(NotesStore::RoleUpdated); | ||
276 | 178 | sort(0, Qt::DescendingOrder); | ||
277 | 179 | break; | ||
278 | 180 | case SortOrderDateUpdatedOldest: | ||
279 | 181 | setSortRole(NotesStore::RoleUpdated); | ||
280 | 182 | sort(0, Qt::AscendingOrder); | ||
281 | 183 | break; | ||
282 | 184 | case SortOrderTitleAscending: | ||
283 | 185 | setSortRole(NotesStore::RoleTitle); | ||
284 | 186 | sort(0, Qt::AscendingOrder); | ||
285 | 187 | break; | ||
286 | 188 | case SortOrderTitleDescending: | ||
287 | 189 | setSortRole(NotesStore::RoleTitle); | ||
288 | 190 | sort(0, Qt::DescendingOrder); | ||
289 | 191 | break; | ||
290 | 192 | } | ||
291 | 193 | m_sortOrder = sortOrder; | ||
292 | 194 | emit sortOrderChanged(); | ||
293 | 195 | emit layoutChanged(); | ||
294 | 196 | } | ||
295 | 197 | } | ||
296 | 198 | |||
297 | 157 | bool Notes::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const | 199 | bool Notes::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const |
298 | 158 | { | 200 | { |
299 | 159 | QModelIndex sourceIndex = sourceModel()->index(sourceRow, 0, sourceParent); | 201 | QModelIndex sourceIndex = sourceModel()->index(sourceRow, 0, sourceParent); |
300 | 160 | 202 | ||
301 | === modified file 'src/libqtevernote/notes.h' | |||
302 | --- src/libqtevernote/notes.h 2014-12-08 10:25:48 +0000 | |||
303 | +++ src/libqtevernote/notes.h 2015-02-21 14:13:56 +0000 | |||
304 | @@ -28,6 +28,7 @@ | |||
305 | 28 | class Notes : public QSortFilterProxyModel | 28 | class Notes : public QSortFilterProxyModel |
306 | 29 | { | 29 | { |
307 | 30 | Q_OBJECT | 30 | Q_OBJECT |
308 | 31 | Q_ENUMS(SortOrder) | ||
309 | 31 | Q_PROPERTY(QString filterNotebookGuid READ filterNotebookGuid WRITE setFilterNotebookGuid NOTIFY filterNotebookGuidChanged) | 32 | Q_PROPERTY(QString filterNotebookGuid READ filterNotebookGuid WRITE setFilterNotebookGuid NOTIFY filterNotebookGuidChanged) |
310 | 32 | Q_PROPERTY(QString filterTagGuid READ filterTagGuid WRITE setFilterTagGuid NOTIFY filterTagGuidChanged) | 33 | Q_PROPERTY(QString filterTagGuid READ filterTagGuid WRITE setFilterTagGuid NOTIFY filterTagGuidChanged) |
311 | 33 | Q_PROPERTY(bool onlyReminders READ onlyReminders WRITE setOnlyReminders NOTIFY onlyRemindersChanged) | 34 | Q_PROPERTY(bool onlyReminders READ onlyReminders WRITE setOnlyReminders NOTIFY onlyRemindersChanged) |
312 | @@ -36,8 +37,18 @@ | |||
313 | 36 | Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged) | 37 | Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged) |
314 | 37 | Q_PROPERTY(QString error READ error NOTIFY errorChanged) | 38 | Q_PROPERTY(QString error READ error NOTIFY errorChanged) |
315 | 38 | Q_PROPERTY(int count READ count NOTIFY countChanged) | 39 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
316 | 40 | Q_PROPERTY(SortOrder sortOrder READ sortOrder WRITE setSortOrder NOTIFY sortOrderChanged) | ||
317 | 39 | 41 | ||
318 | 40 | public: | 42 | public: |
319 | 43 | enum SortOrder { | ||
320 | 44 | SortOrderDateCreatedNewest, | ||
321 | 45 | SortOrderDateCreatedOldest, | ||
322 | 46 | SortOrderDateUpdatedNewest, | ||
323 | 47 | SortOrderDateUpdatedOldest, | ||
324 | 48 | SortOrderTitleAscending, | ||
325 | 49 | SortOrderTitleDescending | ||
326 | 50 | }; | ||
327 | 51 | |||
328 | 41 | explicit Notes(QObject *parent = 0); | 52 | explicit Notes(QObject *parent = 0); |
329 | 42 | 53 | ||
330 | 43 | QString filterNotebookGuid() const; | 54 | QString filterNotebookGuid() const; |
331 | @@ -63,6 +74,9 @@ | |||
332 | 63 | 74 | ||
333 | 64 | Q_INVOKABLE int sectionCount(const QString §ionRole, const QString §ion); | 75 | Q_INVOKABLE int sectionCount(const QString §ionRole, const QString §ion); |
334 | 65 | 76 | ||
335 | 77 | SortOrder sortOrder() const; | ||
336 | 78 | void setSortOrder(SortOrder sortOrder); | ||
337 | 79 | |||
338 | 66 | protected: | 80 | protected: |
339 | 67 | bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; | 81 | bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; |
340 | 68 | bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; | 82 | bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; |
341 | @@ -76,6 +90,7 @@ | |||
342 | 76 | void loadingChanged(); | 90 | void loadingChanged(); |
343 | 77 | void errorChanged(); | 91 | void errorChanged(); |
344 | 78 | void countChanged(); | 92 | void countChanged(); |
345 | 93 | void sortOrderChanged(); | ||
346 | 79 | 94 | ||
347 | 80 | private: | 95 | private: |
348 | 81 | QString m_filterNotebookGuid; | 96 | QString m_filterNotebookGuid; |
349 | @@ -83,6 +98,7 @@ | |||
350 | 83 | bool m_onlyReminders; | 98 | bool m_onlyReminders; |
351 | 84 | bool m_onlySearchResults; | 99 | bool m_onlySearchResults; |
352 | 85 | bool m_showDeleted; | 100 | bool m_showDeleted; |
353 | 101 | SortOrder m_sortOrder; | ||
354 | 86 | }; | 102 | }; |
355 | 87 | 103 | ||
356 | 88 | #endif // NOTES_H | 104 | #endif // NOTES_H |
357 | 89 | 105 | ||
358 | === modified file 'src/libqtevernote/notesstore.cpp' | |||
359 | --- src/libqtevernote/notesstore.cpp 2014-12-16 21:01:28 +0000 | |||
360 | +++ src/libqtevernote/notesstore.cpp 2015-02-21 14:13:56 +0000 | |||
361 | @@ -1142,6 +1142,7 @@ | |||
362 | 1142 | return; | 1142 | return; |
363 | 1143 | } | 1143 | } |
364 | 1144 | note->setUpdateSequenceNumber(note->updateSequenceNumber()+1); | 1144 | note->setUpdateSequenceNumber(note->updateSequenceNumber()+1); |
365 | 1145 | note->setUpdated(QDateTime::currentDateTime()); | ||
366 | 1145 | syncToCacheFile(note); | 1146 | syncToCacheFile(note); |
367 | 1146 | note->syncToCacheFile(); | 1147 | note->syncToCacheFile(); |
368 | 1147 | 1148 |
PASSED: Continuous integration, rev:341 91.189. 93.70:8080/ job/reminders- app-ci/ 644/ 91.189. 93.70:8080/ job/generic- mediumtests- vivid/1057 91.189. 93.70:8080/ job/generic- mediumtests- vivid/1057/ artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/reminders- app-vivid- amd64-ci/ 65
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/reminders- app-ci/ 644/rebuild
http://