diff --git a/src/core/account.h b/src/core/account.h --- a/src/core/account.h +++ b/src/core/account.h @@ -205,6 +205,11 @@ * Returns scope URL for Gmail service. */ static QUrl mailScopeUrl(); + + /** + * Returns scope URL for Drive service. + */ + static QUrl driveScopeUrl(); private: class Private; Private * const d; diff --git a/src/core/account.cpp b/src/core/account.cpp --- a/src/core/account.cpp +++ b/src/core/account.cpp @@ -201,3 +201,8 @@ { return QUrl(QStringLiteral("https://mail.google.com/")); } + +QUrl Account::driveScopeUrl() +{ + return QUrl(QStringLiteral("https://www.googleapis.com/auth/drive")); +} diff --git a/src/drive/filefetchjob.h b/src/drive/filefetchjob.h --- a/src/drive/filefetchjob.h +++ b/src/drive/filefetchjob.h @@ -120,6 +120,9 @@ void setFields(qulonglong fields); qulonglong fields() const; + bool includeTeamDriveItems() const; + void setIncludeTeamDriveItems(bool includeTeamDriveItems); + protected: void start() override; KGAPI2::ObjectsList handleReplyWithItems(const QNetworkReply *reply, diff --git a/src/drive/filefetchjob.cpp b/src/drive/filefetchjob.cpp --- a/src/drive/filefetchjob.cpp +++ b/src/drive/filefetchjob.cpp @@ -46,6 +46,7 @@ FileSearchQuery searchQuery; QStringList filesIDs; bool isFeed; + bool includeTeamDriveItems; bool updateViewedDate; @@ -238,6 +239,12 @@ query.addQueryItem(QStringLiteral("fields"), QStringLiteral("etag,kind,nextLink,nextPageToken,selfLink,items(%1)").arg(fieldsStrings.join(QStringLiteral(",")))); } + + if (includeTeamDriveItems) { + query.addQueryItem(QStringLiteral("includeTeamDriveItems"), QStringLiteral("true")); + query.addQueryItem(QStringLiteral("supportsTeamDrives"), QStringLiteral("true")); + } + url.setQuery(query); } else { if (filesIDs.isEmpty()) { @@ -326,6 +333,16 @@ return d->fields; } +bool FileFetchJob::includeTeamDriveItems() const +{ + return d->includeTeamDriveItems; +} + +void FileFetchJob::setIncludeTeamDriveItems(bool includeTeamDriveItems) +{ + d->includeTeamDriveItems = includeTeamDriveItems; +} + ObjectsList FileFetchJob::handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData)