<table><tr><td style="">barchiesi created this revision.<br />barchiesi added a reviewer: dvratil.<br />barchiesi added a project: LibKGAPI.<br />Herald added a project: KDE PIM.<br />Herald added a subscriber: kde-pim.<br />barchiesi 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/D19368">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>This patch allows fetching files that are children of some Team Drive id, as in the example below. The other change is the insertion of the Drive scope usable during authentication.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>And example of Team Drive file listing:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="c++" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileSearchQuery</span> <span class="n">query</span><span class="p">;</span>
<span class="n">query</span><span class="p">.</span><span class="n">addQuery</span><span class="p">(</span><span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileSearchQuery</span><span style="color: #aa2211">::</span><span class="n">Trashed</span><span class="p">,</span> <span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileSearchQuery</span><span style="color: #aa2211">::</span><span class="n">Equals</span><span class="p">,</span> <span style="color: #304a96">false</span><span class="p">);</span>
<span class="n">query</span><span class="p">.</span><span class="n">addQuery</span><span class="p">(</span><span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileSearchQuery</span><span style="color: #aa2211">::</span><span class="n">Parents</span><span class="p">,</span> <span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileSearchQuery</span><span style="color: #aa2211">::</span><span class="n">In</span><span class="p">,</span> <span style="color: #766510">"someTeamDriveId"</span><span class="p">);</span>
<span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileFetchJob</span> <span style="color: #aa2211">*</span><span class="n">fileFetchJob</span> <span style="color: #aa2211">=</span> <span style="color: #aa4000">new</span> <span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileFetchJob</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">m_account</span><span class="p">,</span> <span style="color: #aa4000">nullptr</span><span class="p">);</span>
<span class="n">fileFetchJob</span><span style="color: #aa2211">-></span><span class="n">setIncludeTeamDrive</span><span class="p">(</span><span style="color: #304a96">true</span><span class="p">);</span>
<span class="n">fileFetchJob</span><span style="color: #aa2211">-></span><span class="n">setFields</span><span class="p">((</span><span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileFetchJob</span><span style="color: #aa2211">::</span><span class="n">BasicFields</span> <span style="color: #aa2211">&</span> <span style="color: #aa2211">~</span><span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileFetchJob</span><span style="color: #aa2211">::</span><span class="n">Permissions</span><span class="p">)</span>
<span style="color: #aa2211">|</span> <span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileFetchJob</span><span style="color: #aa2211">::</span><span class="n">Labels</span>
<span style="color: #aa2211">|</span> <span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileFetchJob</span><span style="color: #aa2211">::</span><span class="n">ExportLinks</span>
<span style="color: #aa2211">|</span> <span class="n">KGAPI2</span><span style="color: #aa2211">::</span><span class="n">Drive</span><span style="color: #aa2211">::</span><span class="n">FileFetchJob</span><span style="color: #aa2211">::</span><span class="n">LastViewedByMeDate</span><span class="p">);</span></pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R477 KGAPI Library</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19368">https://phabricator.kde.org/D19368</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/core/account.cpp<br />
src/core/account.h<br />
src/drive/filefetchjob.cpp<br />
src/drive/filefetchjob.h</div></div></div><br /><div><strong>To: </strong>barchiesi, dvratil<br /><strong>Cc: </strong>kde-pim, LibKGAPI, barchiesi, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>