Fetch Team Drive files and add Drive auth scope
ClosedPublic

Authored by barchiesi on Feb 26 2019, 8:24 PM.

Details

Summary

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.

Test Plan

And example of Team Drive file listing:

KGAPI2::Drive::FileSearchQuery query;
query.addQuery(KGAPI2::Drive::FileSearchQuery::Trashed, KGAPI2::Drive::FileSearchQuery::Equals, false);
query.addQuery(KGAPI2::Drive::FileSearchQuery::Parents, KGAPI2::Drive::FileSearchQuery::In, "someTeamDriveId");

KGAPI2::Drive::FileFetchJob *fileFetchJob = new KGAPI2::Drive::FileFetchJob(query, m_account, nullptr);
fileFetchJob->setIncludeTeamDrive(true);
fileFetchJob->setFields((KGAPI2::Drive::FileFetchJob::BasicFields & ~KGAPI2::Drive::FileFetchJob::Permissions)
                        | KGAPI2::Drive::FileFetchJob::Labels
                        | KGAPI2::Drive::FileFetchJob::ExportLinks
                        | KGAPI2::Drive::FileFetchJob::LastViewedByMeDate);

Diff Detail

Repository
R477 KGAPI Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
barchiesi created this revision.Feb 26 2019, 8:24 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptFeb 26 2019, 8:24 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
barchiesi requested review of this revision.Feb 26 2019, 8:24 PM

Please add a getter for includeTeamDriveItems() as well.

src/drive/filefetchjob.h
123

const not needed here.

dvratil requested changes to this revision.Feb 27 2019, 9:09 AM
This revision now requires changes to proceed.Feb 27 2019, 9:09 AM
barchiesi updated this revision to Diff 52743.Feb 27 2019, 3:53 PM

Added getter.

dvratil accepted this revision.Feb 27 2019, 9:59 PM

Thanks!

This revision is now accepted and ready to land.Feb 27 2019, 9:59 PM
This revision was automatically updated to reflect the committed changes.