<table><tr><td style="">poboiko created this revision.<br />poboiko added a reviewer: dvratil.<br />Herald added a project: KDE PIM.<br />poboiko requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D28162">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This is an implementation of a <tt style="background: #ebebeb; font-size: 13px;">syncToken</tt> Google API feature (see <a href="https://phabricator.kde.org/T8376" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">T8376: [Calendar] Implement support for syncToken</a>, and<br />
<a href="https://developers.google.com/calendar/v3/reference/events/list" class="remarkup-link" target="_blank" rel="noreferrer">https://developers.google.com/calendar/v3/reference/events/list</a>) which is a<br />
native way to perform incremental updates.</p>

<p>When <tt style="background: #ebebeb; font-size: 13px;">EventFetchJob</tt> is created, we can provide it with a token by calling<br />
<tt style="background: #ebebeb; font-size: 13px;">job->setSyncToken(token)</tt>, which will be used as a parameter for fetching.<br />
Note: some of the parameters are incompatible with <tt style="background: #ebebeb; font-size: 13px;">syncToken</tt> (<tt style="background: #ebebeb; font-size: 13px;">timeMin</tt>,<br />
<tt style="background: #ebebeb; font-size: 13px;">timeMax</tt>, <tt style="background: #ebebeb; font-size: 13px;">updatedMin</tt>, see API link above), so if token is provided, those<br />
parameters get ignored.</p>

<p>When the job is finished, the next sync token can be obtained via<br />
<tt style="background: #ebebeb; font-size: 13px;">job->syncToken()</tt>. This token then can be used for the next <tt style="background: #ebebeb; font-size: 13px;">EventFetchJob</tt>.</p></div></div><br /><div><strong>TEST PLAN</strong><div><ol class="remarkup-list">
<li class="remarkup-list-item">Create an <tt style="background: #ebebeb; font-size: 13px;">EventFetchJob</tt> with no <tt style="background: #ebebeb; font-size: 13px;">syncToken</tt></li>
<li class="remarkup-list-item">When job is finished, fetch its <tt style="background: #ebebeb; font-size: 13px;">syncToken</tt></li>
<li class="remarkup-list-item">Create a new job, using previous <tt style="background: #ebebeb; font-size: 13px;">syncToken</tt></li>
<li class="remarkup-list-item">Only incremental changes are obtained</li>
</ol></div></div><br /><div><strong>REPOSITORY</strong><div><div>R477 KGAPI Library</div></div></div><br /><div><strong>BRANCH</strong><div><div>syncToken (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28162">https://phabricator.kde.org/D28162</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/calendar/calendarservice.cpp<br />
src/calendar/eventfetchjob.cpp<br />
src/calendar/eventfetchjob.h<br />
src/core/types.h</div></div></div><br /><div><strong>To: </strong>poboiko, dvratil<br /><strong>Cc: </strong>kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>