Merge lp:~renatofilho/sync-monitor/calendar-start-date into lp:sync-monitor

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 42
Merged at revision: 42
Proposed branch: lp:~renatofilho/sync-monitor/calendar-start-date
Merge into: lp:sync-monitor
Diff against target: 34 lines (+9/-0)
1 file modified
src/sync-configure.cpp (+9/-0)
To merge this branch: bzr merge lp:~renatofilho/sync-monitor/calendar-start-date
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+242082@code.launchpad.net

Commit message

Use the new "syncInterval" filter to limit the number of events retrieved on the first calendar sync.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
42. By Renato Araujo Oliveira Filho

Used "syncInterval" instead of "startDate" for calendar sync filter.

Use 90 days as interval.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/sync-configure.cpp'
--- src/sync-configure.cpp 2014-04-15 22:20:40 +0000
+++ src/sync-configure.cpp 2014-11-20 19:03:27 +0000
@@ -162,14 +162,22 @@
162 config[""]["maxlogdirs"] = "2";162 config[""]["maxlogdirs"] = "2";
163163
164 QString expectedSource;164 QString expectedSource;
165 bool isCalendar = false;
165 if (serviceName == CONTACTS_SERVICE_NAME) {166 if (serviceName == CONTACTS_SERVICE_NAME) {
166 expectedSource = QString("source/addressbook");167 expectedSource = QString("source/addressbook");
167 } else if (serviceName == CALENDAR_SERVICE_NAME) {168 } else if (serviceName == CALENDAR_SERVICE_NAME) {
169 isCalendar = true;
168 expectedSource = QString("source/calendar");170 expectedSource = QString("source/calendar");
169 } else {171 } else {
170 expectedSource = QString("source/%1").arg(serviceName);172 expectedSource = QString("source/%1").arg(serviceName);
171 }173 }
172174
175 if (isCalendar) {
176 // limit the number of retrieve events to optimize the initial query
177 // 3 months before
178 config[expectedSource]["syncInterval"] = "90";
179 }
180
173 bool result = session->saveConfig(targetName, config);181 bool result = session->saveConfig(targetName, config);
174 if (!result) {182 if (!result) {
175 qWarning() << "Fail to save account client config";183 qWarning() << "Fail to save account client config";
@@ -238,6 +246,7 @@
238246
239 config[sourceFullName]["sync"] = syncMode;247 config[sourceFullName]["sync"] = syncMode;
240248
249
241 bool result = session->saveConfig(targetName, config);250 bool result = session->saveConfig(targetName, config);
242 if (!result) {251 if (!result) {
243 qWarning() << "Fail to save account client config";252 qWarning() << "Fail to save account client config";

Subscribers

People subscribed via source and target branches