From 28fa4a5e2af990304d99a38d10af3d94f1987a2671791bd75a9589f10da05cd7 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Sun, 28 Jul 2019 08:22:51 +0000 Subject: [PATCH] Accepting request 719264 from KDE:Extra OBS-URL: https://build.opensuse.org/request/show/719264 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kio-gdrive?expand=0&rev=16 --- Adapt-to-LibKGAPI-setFields-changes.patch | 121 ++++++++++++++++++ ...ss-FileFetchJob-field-specifications.patch | 45 +++++++ kio-gdrive.changes | 9 ++ kio-gdrive.spec | 9 ++ 4 files changed, 184 insertions(+) create mode 100644 Adapt-to-LibKGAPI-setFields-changes.patch create mode 100644 Remove-useless-FileFetchJob-field-specifications.patch diff --git a/Adapt-to-LibKGAPI-setFields-changes.patch b/Adapt-to-LibKGAPI-setFields-changes.patch new file mode 100644 index 0000000..9e3f533 --- /dev/null +++ b/Adapt-to-LibKGAPI-setFields-changes.patch @@ -0,0 +1,121 @@ +From 01ec4d87b2e28de5eb3c23ec469c6c746f573520 Mon Sep 17 00:00:00 2001 +From: David Barchiesi +Date: Sun, 19 May 2019 12:38:24 +0200 +Subject: Adapt to LibKGAPI setFields() changes. + +Summary: +In the next release, LibKGAPI has changed the way it sets fields in `FileFetchJob` and in general allows setting response fields for all `Job`s (see [[ https://phabricator.kde.org/D20886 | D20886 Add fields standard query parameter to Job and use it in FileFetchJob ]]). + +This patch adjusts KIO Gdrive to this change and limits the response in `AboutFetchJob`s. + +Reviewers: dvratil, elvisangelaccio + +Subscribers: #libkgapi, #kio_gdrive + +Tags: #kio_gdrive, #libkgapi + +Differential Revision: https://phabricator.kde.org/D20888 +--- + CMakeLists.txt | 2 +- + src/kio_gdrive.cpp | 30 ++++++++++++++++++------------ + 2 files changed, 19 insertions(+), 13 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a830925..680ae3e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,7 +5,7 @@ project(kio-gdrive VERSION ${GDRIVE_VERSION}) + + set(QT_MIN_VERSION 5.2.0) + set(KF5_MIN_VERSION 5.14.0) +-set(KGAPI_MIN_VERSION 5.5.0) ++set(KGAPI_MIN_VERSION 5.11.41) + set(KACCOUNTS_MIN_VERSION 17.04.0) + set(QTKEYCHAIN_MIN_VERSION 0.6.0) + +diff --git a/src/kio_gdrive.cpp b/src/kio_gdrive.cpp +index 9ab146f..e01fef6 100644 +--- a/src/kio_gdrive.cpp ++++ b/src/kio_gdrive.cpp +@@ -146,6 +146,12 @@ void KIOGDrive::fileSystemFreeSpace(const QUrl &url) + } + if (!gdriveUrl.isRoot()) { + AboutFetchJob aboutFetch(getAccount(accountId)); ++ aboutFetch.setFields({ ++ About::Fields::Kind, ++ About::Fields::QuotaBytesTotal, ++ About::Fields::QuotaBytesUsedAggregate, ++ About::Fields::CanCreateTeamDrives, ++ }); + if (runJob(aboutFetch, url, accountId)) { + const AboutPtr about = aboutFetch.aboutData(); + if (about) { +@@ -379,7 +385,7 @@ QString KIOGDrive::resolveFileIdFromPath(const QString &path, PathFlags flags) + + const QString accountId = gdriveUrl.account(); + FileFetchJob fetchJob(query, getAccount(accountId)); +- fetchJob.setFields(FileFetchJob::Id | FileFetchJob::Title | FileFetchJob::Labels); ++ fetchJob.setFields({File::Fields::Id, File::Fields::Title, File::Fields::Labels}); + if (!runJob(fetchJob, url, accountId)) { + return QString(); + } +@@ -404,6 +410,7 @@ QString KIOGDrive::rootFolderId(const QString &accountId) + auto it = m_rootIds.constFind(accountId); + if (it == m_rootIds.cend()) { + AboutFetchJob aboutFetch(getAccount(accountId)); ++ aboutFetch.setFields({About::Fields::Kind, About::Fields::RootFolderId}); + QUrl url; + if (!runJob(aboutFetch, url, accountId)) { + return QString(); +@@ -455,10 +462,13 @@ void KIOGDrive::listDir(const QUrl &url) + query.addQuery(FileSearchQuery::Trashed, FileSearchQuery::Equals, false); + query.addQuery(FileSearchQuery::Parents, FileSearchQuery::In, folderId); + FileFetchJob fileFetchJob(query, getAccount(accountId)); +- fileFetchJob.setFields((FileFetchJob::BasicFields & ~FileFetchJob::Permissions) +- | FileFetchJob::Labels +- | FileFetchJob::ExportLinks +- | FileFetchJob::LastViewedByMeDate); ++ const auto extraFields = ++ KGAPI2::Drive::FileFetchJob::FieldShorthands::BasicFields + ++ QStringList({ KGAPI2::Drive::File::Fields::Labels, ++ KGAPI2::Drive::File::Fields::ExportLinks, ++ KGAPI2::Drive::File::Fields::LastViewedByMeDate, ++ }); ++ fileFetchJob.setFields(KGAPI2::Drive::FileFetchJob::FieldShorthands::BasicFields + extraFields); + runJob(fileFetchJob, url, accountId); + + ObjectsList objects = fileFetchJob.items(); +@@ -607,10 +617,7 @@ void KIOGDrive::get(const QUrl &url) + } + + FileFetchJob fileFetchJob(fileId, getAccount(accountId)); +- fileFetchJob.setFields(FileFetchJob::Id +- | FileFetchJob::MimeType +- | FileFetchJob::ExportLinks +- | FileFetchJob::DownloadUrl); ++ fileFetchJob.setFields({File::Fields::Id, File::Fields::MimeType, File::Fields::ExportLinks, File::Fields::DownloadUrl}); + runJob(fileFetchJob, url, accountId); + + const ObjectsList objects = fileFetchJob.items(); +@@ -866,8 +873,7 @@ void KIOGDrive::copy(const QUrl &src, const QUrl &dest, int permissions, KIO::Jo + return; + } + FileFetchJob sourceFileFetchJob(sourceFileId, getAccount(sourceAccountId)); +- sourceFileFetchJob.setFields(FileFetchJob::Id | FileFetchJob::ModifiedDate | +- FileFetchJob::LastViewedByMeDate | FileFetchJob::Description); ++ sourceFileFetchJob.setFields({File::Fields::Id, File::Fields::ModifiedDate, File::Fields::LastViewedByMeDate, File::Fields::Description}); + runJob(sourceFileFetchJob, src, sourceAccountId); + + const ObjectsList objects = sourceFileFetchJob.items(); +@@ -1086,7 +1092,7 @@ void KIOGDrive::mimetype(const QUrl &url) + const QString accountId = GDriveUrl(url).account(); + + FileFetchJob fileFetchJob(fileId, getAccount(accountId)); +- fileFetchJob.setFields(FileFetchJob::Id | FileFetchJob::MimeType); ++ fileFetchJob.setFields({File::Fields::Id, File::Fields::MimeType}); + runJob(fileFetchJob, url, accountId); + + const ObjectsList objects = fileFetchJob.items(); +-- +cgit v1.1 + diff --git a/Remove-useless-FileFetchJob-field-specifications.patch b/Remove-useless-FileFetchJob-field-specifications.patch new file mode 100644 index 0000000..c15a886 --- /dev/null +++ b/Remove-useless-FileFetchJob-field-specifications.patch @@ -0,0 +1,45 @@ +From f81aed7bd13fd1d7fcd1f37baade3f1f6f34c54d Mon Sep 17 00:00:00 2001 +From: David Barchiesi +Date: Wed, 3 Jul 2019 20:18:59 +0200 +Subject: Remove useless FileFetchJob field specifications. Fixes D21838 + related issues. + +--- + src/kio_gdrive.cpp | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +(limited to 'src/kio_gdrive.cpp') + +diff --git a/src/kio_gdrive.cpp b/src/kio_gdrive.cpp +index 4d80baf..5add144 100644 +--- a/src/kio_gdrive.cpp ++++ b/src/kio_gdrive.cpp +@@ -149,8 +149,7 @@ void KIOGDrive::fileSystemFreeSpace(const QUrl &url) + aboutFetch.setFields({ + About::Fields::Kind, + About::Fields::QuotaBytesTotal, +- About::Fields::QuotaBytesUsedAggregate, +- About::Fields::CanCreateTeamDrives, ++ About::Fields::QuotaBytesUsedAggregate + }); + if (runJob(aboutFetch, url, accountId)) { + const AboutPtr about = aboutFetch.aboutData(); +@@ -462,11 +461,10 @@ void KIOGDrive::listDir(const QUrl &url) + query.addQuery(FileSearchQuery::Parents, FileSearchQuery::In, folderId); + FileFetchJob fileFetchJob(query, getAccount(accountId)); + const auto extraFields = +- KGAPI2::Drive::FileFetchJob::FieldShorthands::BasicFields + +- QStringList({ KGAPI2::Drive::File::Fields::Labels, +- KGAPI2::Drive::File::Fields::ExportLinks, +- KGAPI2::Drive::File::Fields::LastViewedByMeDate, +- }); ++ QStringList({ KGAPI2::Drive::File::Fields::Labels, ++ KGAPI2::Drive::File::Fields::ExportLinks, ++ KGAPI2::Drive::File::Fields::LastViewedByMeDate, ++ }); + fileFetchJob.setFields(KGAPI2::Drive::FileFetchJob::FieldShorthands::BasicFields + extraFields); + runJob(fileFetchJob, url, accountId); + +-- +cgit v1.1 + diff --git a/kio-gdrive.changes b/kio-gdrive.changes index 1eeb9bc..59f19c4 100644 --- a/kio-gdrive.changes +++ b/kio-gdrive.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sat Jul 27 09:47:56 UTC 2019 - wbauer@tmo.at + +- Add upstream patches to fix build with libkgapi 19.08: + * Adapt-to-LibKGAPI-setFields-changes.patch + * Remove-useless-FileFetchJob-field-specifications.patch +- Add missing BuildRequires explicitly that were pulled in by other + packages + ------------------------------------------------------------------- Tue May 21 12:40:13 UTC 2019 - wbauer@tmo.at diff --git a/kio-gdrive.spec b/kio-gdrive.spec index 89ddaf7..547ab09 100644 --- a/kio-gdrive.spec +++ b/kio-gdrive.spec @@ -25,13 +25,18 @@ License: GPL-2.0-or-later Group: System/GUI/KDE URL: https://community.kde.org/KIO_GDrive Source: https://download.kde.org/stable/%{name}/%{version}/src/%{name}-%{version}.tar.xz +# PATCH-FIX-UPSTREAM +Patch0: Adapt-to-LibKGAPI-setFields-changes.patch +Patch1: Remove-useless-FileFetchJob-field-specifications.patch BuildRequires: extra-cmake-modules BuildRequires: intltool BuildRequires: libaccounts-glib-devel BuildRequires: libsignon-qt5-devel BuildRequires: cmake(KAccounts) +BuildRequires: cmake(KF5DocTools) BuildRequires: cmake(KF5I18n) >= 5.14.0 BuildRequires: cmake(KF5KIO) >= 5.14.0 +BuildRequires: cmake(KF5Notifications) BuildRequires: cmake(KPimGAPI) >= 5.5.0 BuildRequires: cmake(Qt5Network) >= 5.2.0 BuildRequires: cmake(Qt5Widgets) >= 5.2.0 @@ -48,6 +53,10 @@ This can be Dolphin or Gwenview or Konqueror. %prep %setup -q +%if %pkg_vcmp cmake(KPimGAPI) >= 19.07.80 +%patch0 -p1 +%patch1 -p1 +%endif %build %cmake_kf5 -d build