Merge lp:~mzanetti/reminders-app/only-resources into lp:reminders-app
- only-resources
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Michael Zanetti | ||||
Approved revision: | 290 | ||||
Merged at revision: | 297 | ||||
Proposed branch: | lp:~mzanetti/reminders-app/only-resources | ||||
Merge into: | lp:reminders-app | ||||
Prerequisite: | lp:~rpadovani/reminders-app/updatedRole | ||||
Diff against target: |
444 lines (+84/-47) 10 files modified
po/com.ubuntu.reminders.pot (+50/-30) src/libqtevernote/jobs/evernotejob.cpp (+3/-0) src/libqtevernote/jobs/evernotejob.h (+0/-1) src/libqtevernote/jobs/fetchnotejob.cpp (+6/-5) src/libqtevernote/jobs/fetchnotejob.h (+8/-3) src/libqtevernote/jobs/savenotebookjob.h (+2/-0) src/libqtevernote/jobs/savenotejob.h (+2/-0) src/libqtevernote/jobs/savetagjob.h (+2/-0) src/libqtevernote/notesstore.cpp (+8/-6) src/libqtevernote/notesstore.h (+3/-2) |
||||
To merge this branch: | bzr merge lp:~mzanetti/reminders-app/only-resources | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
David Planella | Approve | ||
Review via email: mp+239605@code.launchpad.net |
This proposal supersedes a proposal from 2014-10-24.
Commit message
Don't reload the note's content when reloading a note for its resources
Description of the change
This changes the code to only load resources if we're interested in those instead of reloading the content along with the images. Should slightly improve performance when loading images from the server
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:289
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
David Planella (dpm) : | # |
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
- 290. By Michael Zanetti
-
merge trunk
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:290
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'po/com.ubuntu.reminders.pot' | |||
2 | --- po/com.ubuntu.reminders.pot 2014-11-06 20:08:06 +0000 | |||
3 | +++ po/com.ubuntu.reminders.pot 2014-11-07 19:53:57 +0000 | |||
4 | @@ -8,7 +8,7 @@ | |||
5 | 8 | msgstr "" | 8 | msgstr "" |
6 | 9 | "Project-Id-Version: \n" | 9 | "Project-Id-Version: \n" |
7 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
9 | 11 | "POT-Creation-Date: 2014-10-23 23:05+0200\n" | 11 | "POT-Creation-Date: 2014-11-07 20:51+0100\n" |
10 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
11 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
12 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
13 | @@ -17,7 +17,7 @@ | |||
14 | 17 | "Content-Type: text/plain; charset=CHARSET\n" | 17 | "Content-Type: text/plain; charset=CHARSET\n" |
15 | 18 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
16 | 19 | 19 | ||
18 | 20 | #: com.ubuntu.reminders.desktop.in.in.h:1 src/app/qml/reminders.qml:267 | 20 | #: com.ubuntu.reminders.desktop.in.in.h:1 src/app/qml/reminders.qml:274 |
19 | 21 | msgid "Reminders" | 21 | msgid "Reminders" |
20 | 22 | msgstr "" | 22 | msgstr "" |
21 | 23 | 23 | ||
22 | @@ -38,6 +38,12 @@ | |||
23 | 38 | msgid "Private" | 38 | msgid "Private" |
24 | 39 | msgstr "" | 39 | msgstr "" |
25 | 40 | 40 | ||
26 | 41 | #. TRANSLATORS: the argument is a modification date that follows this format: | ||
27 | 42 | #. http://qt-project.org/doc/qt-5/qml-qtqml-date.html | ||
28 | 43 | #: src/app/qml/components/NotesDelegate.qml:107 | ||
29 | 44 | msgid "dddd, d hh:mm" | ||
30 | 45 | msgstr "" | ||
31 | 46 | |||
32 | 41 | #: src/app/qml/components/PulldownListView.qml:40 | 47 | #: src/app/qml/components/PulldownListView.qml:40 |
33 | 42 | msgid "Release to refresh" | 48 | msgid "Release to refresh" |
34 | 43 | msgstr "" | 49 | msgstr "" |
35 | @@ -55,33 +61,33 @@ | |||
36 | 55 | msgid "Mark as done" | 61 | msgid "Mark as done" |
37 | 56 | msgstr "" | 62 | msgstr "" |
38 | 57 | 63 | ||
40 | 58 | #: src/app/qml/reminders.qml:207 | 64 | #: src/app/qml/reminders.qml:214 |
41 | 59 | msgid "Notes" | 65 | msgid "Notes" |
42 | 60 | msgstr "" | 66 | msgstr "" |
43 | 61 | 67 | ||
45 | 62 | #: src/app/qml/reminders.qml:238 | 68 | #: src/app/qml/reminders.qml:245 |
46 | 63 | msgid "Notebooks" | 69 | msgid "Notebooks" |
47 | 64 | msgstr "" | 70 | msgstr "" |
48 | 65 | 71 | ||
50 | 66 | #: src/app/qml/reminders.qml:282 | 72 | #: src/app/qml/reminders.qml:289 |
51 | 67 | msgid "Tags" | 73 | msgid "Tags" |
52 | 68 | msgstr "" | 74 | msgstr "" |
53 | 69 | 75 | ||
55 | 70 | #: src/app/qml/reminders.qml:322 | 76 | #: src/app/qml/reminders.qml:329 |
56 | 71 | msgid "" | 77 | msgid "" |
57 | 72 | "No note selected.\n" | 78 | "No note selected.\n" |
58 | 73 | "Select a note to see it in detail." | 79 | "Select a note to see it in detail." |
59 | 74 | msgstr "" | 80 | msgstr "" |
60 | 75 | 81 | ||
62 | 76 | #: src/app/qml/reminders.qml:359 | 82 | #: src/app/qml/reminders.qml:366 |
63 | 77 | msgid "No account available" | 83 | msgid "No account available" |
64 | 78 | msgstr "" | 84 | msgstr "" |
65 | 79 | 85 | ||
67 | 80 | #: src/app/qml/reminders.qml:360 | 86 | #: src/app/qml/reminders.qml:367 |
68 | 81 | msgid "Please configure and authorize an Evernote account in System Settings" | 87 | msgid "Please configure and authorize an Evernote account in System Settings" |
69 | 82 | msgstr "" | 88 | msgstr "" |
70 | 83 | 89 | ||
72 | 84 | #: src/app/qml/reminders.qml:380 src/app/qml/ui/AccountSelectorPage.qml:63 | 90 | #: src/app/qml/reminders.qml:387 |
73 | 85 | msgid "Add account" | 91 | msgid "Add account" |
74 | 86 | msgstr "" | 92 | msgstr "" |
75 | 87 | 93 | ||
76 | @@ -89,6 +95,19 @@ | |||
77 | 89 | msgid "Select Evernote account" | 95 | msgid "Select Evernote account" |
78 | 90 | msgstr "" | 96 | msgstr "" |
79 | 91 | 97 | ||
80 | 98 | #: src/app/qml/ui/AccountSelectorPage.qml:74 | ||
81 | 99 | #, qt-format | ||
82 | 100 | msgid "%1 - Tap to authorize" | ||
83 | 101 | msgstr "" | ||
84 | 102 | |||
85 | 103 | #: src/app/qml/ui/AccountSelectorPage.qml:83 | ||
86 | 104 | msgid "Add new account" | ||
87 | 105 | msgstr "" | ||
88 | 106 | |||
89 | 107 | #: src/app/qml/ui/AccountSelectorPage.qml:92 | ||
90 | 108 | msgid "Back" | ||
91 | 109 | msgstr "" | ||
92 | 110 | |||
93 | 92 | #: src/app/qml/ui/EditNoteView.qml:100 src/app/qml/ui/EditNoteView.qml:112 | 111 | #: src/app/qml/ui/EditNoteView.qml:100 src/app/qml/ui/EditNoteView.qml:112 |
94 | 93 | #: src/app/qml/ui/NotesPage.qml:71 | 112 | #: src/app/qml/ui/NotesPage.qml:71 |
95 | 94 | msgid "Untitled" | 113 | msgid "Untitled" |
96 | @@ -141,12 +160,12 @@ | |||
97 | 141 | msgid "Add note" | 160 | msgid "Add note" |
98 | 142 | msgstr "" | 161 | msgstr "" |
99 | 143 | 162 | ||
101 | 144 | #: src/app/qml/ui/NotesPage.qml:214 | 163 | #: src/app/qml/ui/NotesPage.qml:215 |
102 | 145 | msgid "" | 164 | msgid "" |
103 | 146 | "No notes available. You can create new notes using the \"Add note\" button." | 165 | "No notes available. You can create new notes using the \"Add note\" button." |
104 | 147 | msgstr "" | 166 | msgstr "" |
105 | 148 | 167 | ||
107 | 149 | #: src/app/qml/ui/RemindersPage.qml:111 | 168 | #: src/app/qml/ui/RemindersPage.qml:112 |
108 | 150 | msgid "" | 169 | msgid "" |
109 | 151 | "No reminders available. You can create new reminders by setting a reminder " | 170 | "No reminders available. You can create new reminders by setting a reminder " |
110 | 152 | "when viewing a note." | 171 | "when viewing a note." |
111 | @@ -164,69 +183,70 @@ | |||
112 | 164 | msgid "No tags available. You can tag notes while viewing them." | 183 | msgid "No tags available. You can tag notes while viewing them." |
113 | 165 | msgstr "" | 184 | msgstr "" |
114 | 166 | 185 | ||
116 | 167 | #: src/libqtevernote/jobs/evernotejob.cpp:91 | 186 | #: src/libqtevernote/jobs/evernotejob.cpp:94 |
117 | 168 | msgid "Authentication expired." | 187 | msgid "Authentication expired." |
118 | 169 | msgstr "" | 188 | msgstr "" |
119 | 170 | 189 | ||
121 | 171 | #: src/libqtevernote/jobs/evernotejob.cpp:95 | 190 | #: src/libqtevernote/jobs/evernotejob.cpp:98 |
122 | 172 | msgid "Limit exceeded." | 191 | msgid "Limit exceeded." |
123 | 173 | msgstr "" | 192 | msgstr "" |
124 | 174 | 193 | ||
126 | 175 | #: src/libqtevernote/jobs/evernotejob.cpp:99 | 194 | #: src/libqtevernote/jobs/evernotejob.cpp:102 |
127 | 176 | msgid "Rate limit exceeded." | 195 | msgid "Rate limit exceeded." |
128 | 177 | msgstr "" | 196 | msgstr "" |
129 | 178 | 197 | ||
131 | 179 | #: src/libqtevernote/jobs/evernotejob.cpp:103 | 198 | #: src/libqtevernote/jobs/evernotejob.cpp:106 |
132 | 180 | msgid "Quota exceeded." | 199 | msgid "Quota exceeded." |
133 | 181 | msgstr "" | 200 | msgstr "" |
134 | 182 | 201 | ||
136 | 183 | #: src/libqtevernote/note.cpp:82 src/libqtevernote/note.cpp:260 | 202 | #: src/libqtevernote/note.cpp:82 src/libqtevernote/note.cpp:116 |
137 | 203 | #: src/libqtevernote/note.cpp:294 | ||
138 | 184 | msgid "Today" | 204 | msgid "Today" |
139 | 185 | msgstr "" | 205 | msgstr "" |
140 | 186 | 206 | ||
142 | 187 | #: src/libqtevernote/note.cpp:85 | 207 | #: src/libqtevernote/note.cpp:85 src/libqtevernote/note.cpp:119 |
143 | 188 | msgid "Yesterday" | 208 | msgid "Yesterday" |
144 | 189 | msgstr "" | 209 | msgstr "" |
145 | 190 | 210 | ||
147 | 191 | #: src/libqtevernote/note.cpp:88 | 211 | #: src/libqtevernote/note.cpp:88 src/libqtevernote/note.cpp:122 |
148 | 192 | msgid "Last week" | 212 | msgid "Last week" |
149 | 193 | msgstr "" | 213 | msgstr "" |
150 | 194 | 214 | ||
152 | 195 | #: src/libqtevernote/note.cpp:91 | 215 | #: src/libqtevernote/note.cpp:91 src/libqtevernote/note.cpp:125 |
153 | 196 | msgid "Two weeks ago" | 216 | msgid "Two weeks ago" |
154 | 197 | msgstr "" | 217 | msgstr "" |
155 | 198 | 218 | ||
156 | 199 | #. TRANSLATORS: the first argument refers to a month name and the second to a year | 219 | #. TRANSLATORS: the first argument refers to a month name and the second to a year |
158 | 200 | #: src/libqtevernote/note.cpp:95 | 220 | #: src/libqtevernote/note.cpp:95 src/libqtevernote/note.cpp:129 |
159 | 201 | #, qt-format | 221 | #, qt-format |
160 | 202 | msgid "%1 %2" | 222 | msgid "%1 %2" |
161 | 203 | msgstr "" | 223 | msgstr "" |
162 | 204 | 224 | ||
164 | 205 | #: src/libqtevernote/note.cpp:248 | 225 | #: src/libqtevernote/note.cpp:282 |
165 | 206 | msgid "Done" | 226 | msgid "Done" |
166 | 207 | msgstr "" | 227 | msgstr "" |
167 | 208 | 228 | ||
169 | 209 | #: src/libqtevernote/note.cpp:254 | 229 | #: src/libqtevernote/note.cpp:288 |
170 | 210 | msgid "No date" | 230 | msgid "No date" |
171 | 211 | msgstr "" | 231 | msgstr "" |
172 | 212 | 232 | ||
174 | 213 | #: src/libqtevernote/note.cpp:257 | 233 | #: src/libqtevernote/note.cpp:291 |
175 | 214 | msgid "Overdue" | 234 | msgid "Overdue" |
176 | 215 | msgstr "" | 235 | msgstr "" |
177 | 216 | 236 | ||
179 | 217 | #: src/libqtevernote/note.cpp:263 | 237 | #: src/libqtevernote/note.cpp:297 |
180 | 218 | msgid "Tomorrow" | 238 | msgid "Tomorrow" |
181 | 219 | msgstr "" | 239 | msgstr "" |
182 | 220 | 240 | ||
184 | 221 | #: src/libqtevernote/note.cpp:266 | 241 | #: src/libqtevernote/note.cpp:300 |
185 | 222 | msgid "Next week" | 242 | msgid "Next week" |
186 | 223 | msgstr "" | 243 | msgstr "" |
187 | 224 | 244 | ||
189 | 225 | #: src/libqtevernote/note.cpp:269 | 245 | #: src/libqtevernote/note.cpp:303 |
190 | 226 | msgid "In two weeks" | 246 | msgid "In two weeks" |
191 | 227 | msgstr "" | 247 | msgstr "" |
192 | 228 | 248 | ||
194 | 229 | #: src/libqtevernote/note.cpp:271 | 249 | #: src/libqtevernote/note.cpp:305 |
195 | 230 | msgid "Later" | 250 | msgid "Later" |
196 | 231 | msgstr "" | 251 | msgstr "" |
197 | 232 | 252 | ||
198 | @@ -257,17 +277,17 @@ | |||
199 | 257 | msgid "on %1 %2" | 277 | msgid "on %1 %2" |
200 | 258 | msgstr "" | 278 | msgstr "" |
201 | 259 | 279 | ||
203 | 260 | #: src/libqtevernote/notesstore.cpp:361 | 280 | #: src/libqtevernote/notesstore.cpp:366 |
204 | 261 | #, qt-format | 281 | #, qt-format |
205 | 262 | msgid "Error refreshing notes: %1" | 282 | msgid "Error refreshing notes: %1" |
206 | 263 | msgstr "" | 283 | msgstr "" |
207 | 264 | 284 | ||
209 | 265 | #: src/libqtevernote/notesstore.cpp:542 | 285 | #: src/libqtevernote/notesstore.cpp:551 |
210 | 266 | #, qt-format | 286 | #, qt-format |
211 | 267 | msgid "Error refreshing notebooks: %1" | 287 | msgid "Error refreshing notebooks: %1" |
212 | 268 | msgstr "" | 288 | msgstr "" |
213 | 269 | 289 | ||
215 | 270 | #: src/libqtevernote/notesstore.cpp:596 | 290 | #: src/libqtevernote/notesstore.cpp:605 |
216 | 271 | #, qt-format | 291 | #, qt-format |
217 | 272 | msgid "Error refreshing tags: %1" | 292 | msgid "Error refreshing tags: %1" |
218 | 273 | msgstr "" | 293 | msgstr "" |
219 | 274 | 294 | ||
220 | === modified file 'src/libqtevernote/jobs/evernotejob.cpp' | |||
221 | --- src/libqtevernote/jobs/evernotejob.cpp 2014-09-19 21:36:50 +0000 | |||
222 | +++ src/libqtevernote/jobs/evernotejob.cpp 2014-11-07 19:53:57 +0000 | |||
223 | @@ -28,6 +28,9 @@ | |||
224 | 28 | #include <transport/TSSLSocket.h> | 28 | #include <transport/TSSLSocket.h> |
225 | 29 | #include <Thrift.h> | 29 | #include <Thrift.h> |
226 | 30 | 30 | ||
227 | 31 | // Evernote SDK | ||
228 | 32 | #include <Errors_types.h> | ||
229 | 33 | |||
230 | 31 | #include <libintl.h> | 34 | #include <libintl.h> |
231 | 32 | 35 | ||
232 | 33 | #include <QDebug> | 36 | #include <QDebug> |
233 | 34 | 37 | ||
234 | === modified file 'src/libqtevernote/jobs/evernotejob.h' | |||
235 | --- src/libqtevernote/jobs/evernotejob.h 2014-09-19 21:31:39 +0000 | |||
236 | +++ src/libqtevernote/jobs/evernotejob.h 2014-11-07 19:53:57 +0000 | |||
237 | @@ -21,7 +21,6 @@ | |||
238 | 21 | #ifndef EVERNOTEJOB_H | 21 | #ifndef EVERNOTEJOB_H |
239 | 22 | #define EVERNOTEJOB_H | 22 | #define EVERNOTEJOB_H |
240 | 23 | 23 | ||
241 | 24 | #include "notesstore.h" | ||
242 | 25 | #include "evernoteconnection.h" | 24 | #include "evernoteconnection.h" |
243 | 26 | 25 | ||
244 | 27 | #include <QThread> | 26 | #include <QThread> |
245 | 28 | 27 | ||
246 | === modified file 'src/libqtevernote/jobs/fetchnotejob.cpp' | |||
247 | --- src/libqtevernote/jobs/fetchnotejob.cpp 2014-09-19 21:31:39 +0000 | |||
248 | +++ src/libqtevernote/jobs/fetchnotejob.cpp 2014-11-07 19:53:57 +0000 | |||
249 | @@ -20,11 +20,12 @@ | |||
250 | 20 | 20 | ||
251 | 21 | #include "fetchnotejob.h" | 21 | #include "fetchnotejob.h" |
252 | 22 | 22 | ||
254 | 23 | FetchNoteJob::FetchNoteJob(const QString &guid, bool withResources, QObject *parent) : | 23 | FetchNoteJob::FetchNoteJob(const QString &guid, LoadWhat what, QObject *parent) : |
255 | 24 | NotesStoreJob(parent), | 24 | NotesStoreJob(parent), |
256 | 25 | m_guid(guid), | 25 | m_guid(guid), |
258 | 26 | m_withResources(withResources) | 26 | m_what(what) |
259 | 27 | { | 27 | { |
260 | 28 | qRegisterMetaType<LoadWhat>("LoadWhat"); | ||
261 | 28 | } | 29 | } |
262 | 29 | 30 | ||
263 | 30 | bool FetchNoteJob::operator==(const EvernoteJob *other) const | 31 | bool FetchNoteJob::operator==(const EvernoteJob *other) const |
264 | @@ -33,7 +34,7 @@ | |||
265 | 33 | if (!otherJob) { | 34 | if (!otherJob) { |
266 | 34 | return false; | 35 | return false; |
267 | 35 | } | 36 | } |
269 | 36 | return this->m_guid == otherJob->m_guid && this->m_withResources == otherJob->m_withResources; | 37 | return this->m_guid == otherJob->m_guid && this->m_what == otherJob->m_what; |
270 | 37 | } | 38 | } |
271 | 38 | 39 | ||
272 | 39 | void FetchNoteJob::attachToDuplicate(const EvernoteJob *other) | 40 | void FetchNoteJob::attachToDuplicate(const EvernoteJob *other) |
273 | @@ -44,10 +45,10 @@ | |||
274 | 44 | 45 | ||
275 | 45 | void FetchNoteJob::startJob() | 46 | void FetchNoteJob::startJob() |
276 | 46 | { | 47 | { |
278 | 47 | client()->getNote(m_result, token().toStdString(), m_guid.toStdString(), true, m_withResources, false, false); | 48 | client()->getNote(m_result, token().toStdString(), m_guid.toStdString(), m_what == LoadContent, m_what == LoadResources, false, false); |
279 | 48 | } | 49 | } |
280 | 49 | 50 | ||
281 | 50 | void FetchNoteJob::emitJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage) | 51 | void FetchNoteJob::emitJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage) |
282 | 51 | { | 52 | { |
284 | 52 | emit resultReady(errorCode, errorMessage, m_result, m_withResources); | 53 | emit resultReady(errorCode, errorMessage, m_result, m_what); |
285 | 53 | } | 54 | } |
286 | 54 | 55 | ||
287 | === modified file 'src/libqtevernote/jobs/fetchnotejob.h' | |||
288 | --- src/libqtevernote/jobs/fetchnotejob.h 2014-09-19 21:31:39 +0000 | |||
289 | +++ src/libqtevernote/jobs/fetchnotejob.h 2014-11-07 19:53:57 +0000 | |||
290 | @@ -27,13 +27,18 @@ | |||
291 | 27 | { | 27 | { |
292 | 28 | Q_OBJECT | 28 | Q_OBJECT |
293 | 29 | public: | 29 | public: |
295 | 30 | explicit FetchNoteJob(const QString &guid, bool withResources, QObject *parent = 0); | 30 | enum LoadWhat { |
296 | 31 | LoadContent, | ||
297 | 32 | LoadResources | ||
298 | 33 | }; | ||
299 | 34 | |||
300 | 35 | explicit FetchNoteJob(const QString &guid, LoadWhat what, QObject *parent = 0); | ||
301 | 31 | 36 | ||
302 | 32 | virtual bool operator==(const EvernoteJob *other) const override; | 37 | virtual bool operator==(const EvernoteJob *other) const override; |
303 | 33 | virtual void attachToDuplicate(const EvernoteJob *other) override; | 38 | virtual void attachToDuplicate(const EvernoteJob *other) override; |
304 | 34 | 39 | ||
305 | 35 | signals: | 40 | signals: |
307 | 36 | void resultReady(EvernoteConnection::ErrorCode error, const QString &errorMessage, const evernote::edam::Note ¬e, bool withResourceContent); | 41 | void resultReady(EvernoteConnection::ErrorCode error, const QString &errorMessage, const evernote::edam::Note ¬e, LoadWhat what); |
308 | 37 | 42 | ||
309 | 38 | protected: | 43 | protected: |
310 | 39 | void startJob(); | 44 | void startJob(); |
311 | @@ -43,7 +48,7 @@ | |||
312 | 43 | evernote::edam::NoteStoreClient *m_client; | 48 | evernote::edam::NoteStoreClient *m_client; |
313 | 44 | QString m_token; | 49 | QString m_token; |
314 | 45 | QString m_guid; | 50 | QString m_guid; |
316 | 46 | bool m_withResources; | 51 | LoadWhat m_what; |
317 | 47 | 52 | ||
318 | 48 | evernote::edam::Note m_result; | 53 | evernote::edam::Note m_result; |
319 | 49 | 54 | ||
320 | 50 | 55 | ||
321 | === modified file 'src/libqtevernote/jobs/savenotebookjob.h' | |||
322 | --- src/libqtevernote/jobs/savenotebookjob.h 2014-09-19 21:31:39 +0000 | |||
323 | +++ src/libqtevernote/jobs/savenotebookjob.h 2014-11-07 19:53:57 +0000 | |||
324 | @@ -23,6 +23,8 @@ | |||
325 | 23 | 23 | ||
326 | 24 | #include "notesstorejob.h" | 24 | #include "notesstorejob.h" |
327 | 25 | 25 | ||
328 | 26 | class Notebook; | ||
329 | 27 | |||
330 | 26 | class SaveNotebookJob : public NotesStoreJob | 28 | class SaveNotebookJob : public NotesStoreJob |
331 | 27 | { | 29 | { |
332 | 28 | Q_OBJECT | 30 | Q_OBJECT |
333 | 29 | 31 | ||
334 | === modified file 'src/libqtevernote/jobs/savenotejob.h' | |||
335 | --- src/libqtevernote/jobs/savenotejob.h 2014-09-19 21:31:39 +0000 | |||
336 | +++ src/libqtevernote/jobs/savenotejob.h 2014-11-07 19:53:57 +0000 | |||
337 | @@ -23,6 +23,8 @@ | |||
338 | 23 | 23 | ||
339 | 24 | #include "notesstorejob.h" | 24 | #include "notesstorejob.h" |
340 | 25 | 25 | ||
341 | 26 | class Note; | ||
342 | 27 | |||
343 | 26 | class SaveNoteJob : public NotesStoreJob | 28 | class SaveNoteJob : public NotesStoreJob |
344 | 27 | { | 29 | { |
345 | 28 | Q_OBJECT | 30 | Q_OBJECT |
346 | 29 | 31 | ||
347 | === modified file 'src/libqtevernote/jobs/savetagjob.h' | |||
348 | --- src/libqtevernote/jobs/savetagjob.h 2014-10-09 00:08:52 +0000 | |||
349 | +++ src/libqtevernote/jobs/savetagjob.h 2014-11-07 19:53:57 +0000 | |||
350 | @@ -23,6 +23,8 @@ | |||
351 | 23 | 23 | ||
352 | 24 | #include "notesstorejob.h" | 24 | #include "notesstorejob.h" |
353 | 25 | 25 | ||
354 | 26 | class Tag; | ||
355 | 27 | |||
356 | 26 | class SaveTagJob : public NotesStoreJob | 28 | class SaveTagJob : public NotesStoreJob |
357 | 27 | { | 29 | { |
358 | 28 | Q_OBJECT | 30 | Q_OBJECT |
359 | 29 | 31 | ||
360 | === modified file 'src/libqtevernote/notesstore.cpp' | |||
361 | --- src/libqtevernote/notesstore.cpp 2014-11-07 19:30:58 +0000 | |||
362 | +++ src/libqtevernote/notesstore.cpp 2014-11-07 19:53:57 +0000 | |||
363 | @@ -448,19 +448,19 @@ | |||
364 | 448 | } | 448 | } |
365 | 449 | } | 449 | } |
366 | 450 | 450 | ||
368 | 451 | void NotesStore::refreshNoteContent(const QString &guid, bool withResourceContent) | 451 | void NotesStore::refreshNoteContent(const QString &guid, FetchNoteJob::LoadWhat what) |
369 | 452 | { | 452 | { |
370 | 453 | Note *note = m_notesHash.value(guid); | 453 | Note *note = m_notesHash.value(guid); |
371 | 454 | if (note) { | 454 | if (note) { |
372 | 455 | note->setLoading(true); | 455 | note->setLoading(true); |
373 | 456 | } | 456 | } |
374 | 457 | 457 | ||
376 | 458 | FetchNoteJob *job = new FetchNoteJob(guid, withResourceContent, this); | 458 | FetchNoteJob *job = new FetchNoteJob(guid, what, this); |
377 | 459 | connect(job, &FetchNoteJob::resultReady, this, &NotesStore::fetchNoteJobDone); | 459 | connect(job, &FetchNoteJob::resultReady, this, &NotesStore::fetchNoteJobDone); |
378 | 460 | EvernoteConnection::instance()->enqueue(job); | 460 | EvernoteConnection::instance()->enqueue(job); |
379 | 461 | } | 461 | } |
380 | 462 | 462 | ||
382 | 463 | void NotesStore::fetchNoteJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::Note &result, bool withResourceContent) | 463 | void NotesStore::fetchNoteJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::Note &result, FetchNoteJob::LoadWhat what) |
383 | 464 | { | 464 | { |
384 | 465 | if (errorCode != EvernoteConnection::ErrorCodeNoError) { | 465 | if (errorCode != EvernoteConnection::ErrorCodeNoError) { |
385 | 466 | qWarning() << "Error fetching note:" << errorMessage; | 466 | qWarning() << "Error fetching note:" << errorMessage; |
386 | @@ -490,7 +490,7 @@ | |||
387 | 490 | QString fileName = QString::fromStdString(resource.attributes.fileName); | 490 | QString fileName = QString::fromStdString(resource.attributes.fileName); |
388 | 491 | QString mime = QString::fromStdString(resource.mime); | 491 | QString mime = QString::fromStdString(resource.mime); |
389 | 492 | 492 | ||
391 | 493 | if (withResourceContent) { | 493 | if (what == FetchNoteJob::LoadResources) { |
392 | 494 | QByteArray resourceData = QByteArray(resource.data.body.data(), resource.data.size); | 494 | QByteArray resourceData = QByteArray(resource.data.body.data(), resource.data.size); |
393 | 495 | note->addResource(resourceData, hash, fileName, mime); | 495 | note->addResource(resourceData, hash, fileName, mime); |
394 | 496 | } else if (Resource::isCached(hash)) { | 496 | } else if (Resource::isCached(hash)) { |
395 | @@ -500,7 +500,9 @@ | |||
396 | 500 | } | 500 | } |
397 | 501 | } | 501 | } |
398 | 502 | 502 | ||
400 | 503 | note->setEnmlContent(QString::fromStdString(result.content)); | 503 | if (what == FetchNoteJob::LoadContent) { |
401 | 504 | note->setEnmlContent(QString::fromStdString(result.content)); | ||
402 | 505 | } | ||
403 | 504 | note->setReminderOrder(result.attributes.reminderOrder); | 506 | note->setReminderOrder(result.attributes.reminderOrder); |
404 | 505 | QDateTime reminderTime; | 507 | QDateTime reminderTime; |
405 | 506 | if (result.attributes.reminderTime > 0) { | 508 | if (result.attributes.reminderTime > 0) { |
406 | @@ -518,7 +520,7 @@ | |||
407 | 518 | emit dataChanged(noteIndex, noteIndex); | 520 | emit dataChanged(noteIndex, noteIndex); |
408 | 519 | 521 | ||
409 | 520 | if (refreshWithResourceData) { | 522 | if (refreshWithResourceData) { |
411 | 521 | refreshNoteContent(note->guid(), true); | 523 | refreshNoteContent(note->guid(), FetchNoteJob::LoadResources); |
412 | 522 | } | 524 | } |
413 | 523 | } | 525 | } |
414 | 524 | 526 | ||
415 | 525 | 527 | ||
416 | === modified file 'src/libqtevernote/notesstore.h' | |||
417 | --- src/libqtevernote/notesstore.h 2014-11-07 19:30:58 +0000 | |||
418 | +++ src/libqtevernote/notesstore.h 2014-11-07 19:53:57 +0000 | |||
419 | @@ -23,6 +23,7 @@ | |||
420 | 23 | 23 | ||
421 | 24 | #include "evernoteconnection.h" | 24 | #include "evernoteconnection.h" |
422 | 25 | #include "utils/enmldocument.h" | 25 | #include "utils/enmldocument.h" |
423 | 26 | #include "jobs/fetchnotejob.h" | ||
424 | 26 | 27 | ||
425 | 27 | // Thrift | 28 | // Thrift |
426 | 28 | #include <arpa/inet.h> // seems thrift forgot this one | 29 | #include <arpa/inet.h> // seems thrift forgot this one |
427 | @@ -122,7 +123,7 @@ | |||
428 | 122 | 123 | ||
429 | 123 | public slots: | 124 | public slots: |
430 | 124 | void refreshNotes(const QString &filterNotebookGuid = QString(), int startIndex = 0); | 125 | void refreshNotes(const QString &filterNotebookGuid = QString(), int startIndex = 0); |
432 | 125 | void refreshNoteContent(const QString &guid, bool withResourceContent = false); | 126 | void refreshNoteContent(const QString &guid, FetchNoteJob::LoadWhat what = FetchNoteJob::LoadContent); |
433 | 126 | void refreshNotebooks(); | 127 | void refreshNotebooks(); |
434 | 127 | void refreshTags(); | 128 | void refreshTags(); |
435 | 128 | 129 | ||
436 | @@ -153,7 +154,7 @@ | |||
437 | 153 | private slots: | 154 | private slots: |
438 | 154 | void fetchNotesJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::NotesMetadataList &results, const QString &filterNotebookGuid); | 155 | void fetchNotesJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::NotesMetadataList &results, const QString &filterNotebookGuid); |
439 | 155 | void fetchNotebooksJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const std::vector<evernote::edam::Notebook> &results); | 156 | void fetchNotebooksJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const std::vector<evernote::edam::Notebook> &results); |
441 | 156 | void fetchNoteJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::Note &result, bool withResourceContent); | 157 | void fetchNoteJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::Note &result, FetchNoteJob::LoadWhat what); |
442 | 157 | void createNoteJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::Note &result); | 158 | void createNoteJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::Note &result); |
443 | 158 | void saveNoteJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::Note &result); | 159 | void saveNoteJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage, const evernote::edam::Note &result); |
444 | 159 | void saveNotebookJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage); | 160 | void saveNotebookJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage); |
PASSED: Continuous integration, rev:288 91.189. 93.70:8080/ job/reminders- app-ci/ 570/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic- python3/ 1266 91.189. 93.70:8080/ job/generic- mediumtests- utopic- python3/ 1266/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/reminders- app-utopic- amd64-ci/ 266
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/ 570/rebuild
http://