1 |
commit: 78569d482a5866088bc6d9ebf3adcff8f864d2db |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 15 14:44:29 2019 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 15 17:09:43 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78569d48 |
7 |
|
8 |
kde-misc/kio-gdrive: Revbump for >=kde-apps/libkgapi-19.08.0 compat |
9 |
|
10 |
Package-Manager: Portage-2.3.71, Repoman-2.3.17 |
11 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
12 |
|
13 |
.../files/kio-gdrive-1.2.6-libkgapi-19.08-1.patch | 120 +++++++++++++++++++++ |
14 |
.../files/kio-gdrive-1.2.6-libkgapi-19.08-2.patch | 42 ++++++++ |
15 |
kde-misc/kio-gdrive/kio-gdrive-1.2.6-r1.ebuild | 49 +++++++++ |
16 |
3 files changed, 211 insertions(+) |
17 |
|
18 |
diff --git a/kde-misc/kio-gdrive/files/kio-gdrive-1.2.6-libkgapi-19.08-1.patch b/kde-misc/kio-gdrive/files/kio-gdrive-1.2.6-libkgapi-19.08-1.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..03352081b73 |
21 |
--- /dev/null |
22 |
+++ b/kde-misc/kio-gdrive/files/kio-gdrive-1.2.6-libkgapi-19.08-1.patch |
23 |
@@ -0,0 +1,120 @@ |
24 |
+From 01ec4d87b2e28de5eb3c23ec469c6c746f573520 Mon Sep 17 00:00:00 2001 |
25 |
+From: David Barchiesi <david@×××××××.si> |
26 |
+Date: Sun, 19 May 2019 12:38:24 +0200 |
27 |
+Subject: Adapt to LibKGAPI setFields() changes. |
28 |
+ |
29 |
+Summary: |
30 |
+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 ]]). |
31 |
+ |
32 |
+This patch adjusts KIO Gdrive to this change and limits the response in `AboutFetchJob`s. |
33 |
+ |
34 |
+Reviewers: dvratil, elvisangelaccio |
35 |
+ |
36 |
+Subscribers: #libkgapi, #kio_gdrive |
37 |
+ |
38 |
+Tags: #kio_gdrive, #libkgapi |
39 |
+ |
40 |
+Differential Revision: https://phabricator.kde.org/D20888 |
41 |
+--- |
42 |
+ CMakeLists.txt | 2 +- |
43 |
+ src/kio_gdrive.cpp | 30 ++++++++++++++++++------------ |
44 |
+ 2 files changed, 19 insertions(+), 13 deletions(-) |
45 |
+ |
46 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
47 |
+index a830925..680ae3e 100644 |
48 |
+--- a/CMakeLists.txt |
49 |
++++ b/CMakeLists.txt |
50 |
+@@ -5,7 +5,7 @@ project(kio-gdrive VERSION ${GDRIVE_VERSION}) |
51 |
+ |
52 |
+ set(QT_MIN_VERSION 5.2.0) |
53 |
+ set(KF5_MIN_VERSION 5.14.0) |
54 |
+-set(KGAPI_MIN_VERSION 5.5.0) |
55 |
++set(KGAPI_MIN_VERSION 5.11.41) |
56 |
+ set(KACCOUNTS_MIN_VERSION 17.04.0) |
57 |
+ set(QTKEYCHAIN_MIN_VERSION 0.6.0) |
58 |
+ |
59 |
+diff --git a/src/kio_gdrive.cpp b/src/kio_gdrive.cpp |
60 |
+index 9ab146f..e01fef6 100644 |
61 |
+--- a/src/kio_gdrive.cpp |
62 |
++++ b/src/kio_gdrive.cpp |
63 |
+@@ -146,6 +146,12 @@ void KIOGDrive::fileSystemFreeSpace(const QUrl &url) |
64 |
+ } |
65 |
+ if (!gdriveUrl.isRoot()) { |
66 |
+ AboutFetchJob aboutFetch(getAccount(accountId)); |
67 |
++ aboutFetch.setFields({ |
68 |
++ About::Fields::Kind, |
69 |
++ About::Fields::QuotaBytesTotal, |
70 |
++ About::Fields::QuotaBytesUsedAggregate, |
71 |
++ About::Fields::CanCreateTeamDrives, |
72 |
++ }); |
73 |
+ if (runJob(aboutFetch, url, accountId)) { |
74 |
+ const AboutPtr about = aboutFetch.aboutData(); |
75 |
+ if (about) { |
76 |
+@@ -379,7 +385,7 @@ QString KIOGDrive::resolveFileIdFromPath(const QString &path, PathFlags flags) |
77 |
+ |
78 |
+ const QString accountId = gdriveUrl.account(); |
79 |
+ FileFetchJob fetchJob(query, getAccount(accountId)); |
80 |
+- fetchJob.setFields(FileFetchJob::Id | FileFetchJob::Title | FileFetchJob::Labels); |
81 |
++ fetchJob.setFields({File::Fields::Id, File::Fields::Title, File::Fields::Labels}); |
82 |
+ if (!runJob(fetchJob, url, accountId)) { |
83 |
+ return QString(); |
84 |
+ } |
85 |
+@@ -404,6 +410,7 @@ QString KIOGDrive::rootFolderId(const QString &accountId) |
86 |
+ auto it = m_rootIds.constFind(accountId); |
87 |
+ if (it == m_rootIds.cend()) { |
88 |
+ AboutFetchJob aboutFetch(getAccount(accountId)); |
89 |
++ aboutFetch.setFields({About::Fields::Kind, About::Fields::RootFolderId}); |
90 |
+ QUrl url; |
91 |
+ if (!runJob(aboutFetch, url, accountId)) { |
92 |
+ return QString(); |
93 |
+@@ -455,10 +462,13 @@ void KIOGDrive::listDir(const QUrl &url) |
94 |
+ query.addQuery(FileSearchQuery::Trashed, FileSearchQuery::Equals, false); |
95 |
+ query.addQuery(FileSearchQuery::Parents, FileSearchQuery::In, folderId); |
96 |
+ FileFetchJob fileFetchJob(query, getAccount(accountId)); |
97 |
+- fileFetchJob.setFields((FileFetchJob::BasicFields & ~FileFetchJob::Permissions) |
98 |
+- | FileFetchJob::Labels |
99 |
+- | FileFetchJob::ExportLinks |
100 |
+- | FileFetchJob::LastViewedByMeDate); |
101 |
++ const auto extraFields = |
102 |
++ KGAPI2::Drive::FileFetchJob::FieldShorthands::BasicFields + |
103 |
++ QStringList({ KGAPI2::Drive::File::Fields::Labels, |
104 |
++ KGAPI2::Drive::File::Fields::ExportLinks, |
105 |
++ KGAPI2::Drive::File::Fields::LastViewedByMeDate, |
106 |
++ }); |
107 |
++ fileFetchJob.setFields(KGAPI2::Drive::FileFetchJob::FieldShorthands::BasicFields + extraFields); |
108 |
+ runJob(fileFetchJob, url, accountId); |
109 |
+ |
110 |
+ ObjectsList objects = fileFetchJob.items(); |
111 |
+@@ -607,10 +617,7 @@ void KIOGDrive::get(const QUrl &url) |
112 |
+ } |
113 |
+ |
114 |
+ FileFetchJob fileFetchJob(fileId, getAccount(accountId)); |
115 |
+- fileFetchJob.setFields(FileFetchJob::Id |
116 |
+- | FileFetchJob::MimeType |
117 |
+- | FileFetchJob::ExportLinks |
118 |
+- | FileFetchJob::DownloadUrl); |
119 |
++ fileFetchJob.setFields({File::Fields::Id, File::Fields::MimeType, File::Fields::ExportLinks, File::Fields::DownloadUrl}); |
120 |
+ runJob(fileFetchJob, url, accountId); |
121 |
+ |
122 |
+ const ObjectsList objects = fileFetchJob.items(); |
123 |
+@@ -866,8 +873,7 @@ void KIOGDrive::copy(const QUrl &src, const QUrl &dest, int permissions, KIO::Jo |
124 |
+ return; |
125 |
+ } |
126 |
+ FileFetchJob sourceFileFetchJob(sourceFileId, getAccount(sourceAccountId)); |
127 |
+- sourceFileFetchJob.setFields(FileFetchJob::Id | FileFetchJob::ModifiedDate | |
128 |
+- FileFetchJob::LastViewedByMeDate | FileFetchJob::Description); |
129 |
++ sourceFileFetchJob.setFields({File::Fields::Id, File::Fields::ModifiedDate, File::Fields::LastViewedByMeDate, File::Fields::Description}); |
130 |
+ runJob(sourceFileFetchJob, src, sourceAccountId); |
131 |
+ |
132 |
+ const ObjectsList objects = sourceFileFetchJob.items(); |
133 |
+@@ -1086,7 +1092,7 @@ void KIOGDrive::mimetype(const QUrl &url) |
134 |
+ const QString accountId = GDriveUrl(url).account(); |
135 |
+ |
136 |
+ FileFetchJob fileFetchJob(fileId, getAccount(accountId)); |
137 |
+- fileFetchJob.setFields(FileFetchJob::Id | FileFetchJob::MimeType); |
138 |
++ fileFetchJob.setFields({File::Fields::Id, File::Fields::MimeType}); |
139 |
+ runJob(fileFetchJob, url, accountId); |
140 |
+ |
141 |
+ const ObjectsList objects = fileFetchJob.items(); |
142 |
+-- |
143 |
+cgit v1.1 |
144 |
|
145 |
diff --git a/kde-misc/kio-gdrive/files/kio-gdrive-1.2.6-libkgapi-19.08-2.patch b/kde-misc/kio-gdrive/files/kio-gdrive-1.2.6-libkgapi-19.08-2.patch |
146 |
new file mode 100644 |
147 |
index 00000000000..65d181ca7a5 |
148 |
--- /dev/null |
149 |
+++ b/kde-misc/kio-gdrive/files/kio-gdrive-1.2.6-libkgapi-19.08-2.patch |
150 |
@@ -0,0 +1,42 @@ |
151 |
+From f81aed7bd13fd1d7fcd1f37baade3f1f6f34c54d Mon Sep 17 00:00:00 2001 |
152 |
+From: David Barchiesi <david@×××××××.si> |
153 |
+Date: Wed, 3 Jul 2019 20:18:59 +0200 |
154 |
+Subject: Remove useless FileFetchJob field specifications. Fixes D21838 |
155 |
+ related issues. |
156 |
+ |
157 |
+--- |
158 |
+ src/kio_gdrive.cpp | 12 +++++------- |
159 |
+ 1 file changed, 5 insertions(+), 7 deletions(-) |
160 |
+ |
161 |
+diff --git a/src/kio_gdrive.cpp b/src/kio_gdrive.cpp |
162 |
+index 4d80baf..5add144 100644 |
163 |
+--- a/src/kio_gdrive.cpp |
164 |
++++ b/src/kio_gdrive.cpp |
165 |
+@@ -149,8 +149,7 @@ void KIOGDrive::fileSystemFreeSpace(const QUrl &url) |
166 |
+ aboutFetch.setFields({ |
167 |
+ About::Fields::Kind, |
168 |
+ About::Fields::QuotaBytesTotal, |
169 |
+- About::Fields::QuotaBytesUsedAggregate, |
170 |
+- About::Fields::CanCreateTeamDrives, |
171 |
++ About::Fields::QuotaBytesUsedAggregate |
172 |
+ }); |
173 |
+ if (runJob(aboutFetch, url, accountId)) { |
174 |
+ const AboutPtr about = aboutFetch.aboutData(); |
175 |
+@@ -462,11 +461,10 @@ void KIOGDrive::listDir(const QUrl &url) |
176 |
+ query.addQuery(FileSearchQuery::Parents, FileSearchQuery::In, folderId); |
177 |
+ FileFetchJob fileFetchJob(query, getAccount(accountId)); |
178 |
+ const auto extraFields = |
179 |
+- KGAPI2::Drive::FileFetchJob::FieldShorthands::BasicFields + |
180 |
+- QStringList({ KGAPI2::Drive::File::Fields::Labels, |
181 |
+- KGAPI2::Drive::File::Fields::ExportLinks, |
182 |
+- KGAPI2::Drive::File::Fields::LastViewedByMeDate, |
183 |
+- }); |
184 |
++ QStringList({ KGAPI2::Drive::File::Fields::Labels, |
185 |
++ KGAPI2::Drive::File::Fields::ExportLinks, |
186 |
++ KGAPI2::Drive::File::Fields::LastViewedByMeDate, |
187 |
++ }); |
188 |
+ fileFetchJob.setFields(KGAPI2::Drive::FileFetchJob::FieldShorthands::BasicFields + extraFields); |
189 |
+ runJob(fileFetchJob, url, accountId); |
190 |
+ |
191 |
+-- |
192 |
+cgit v1.1 |
193 |
|
194 |
diff --git a/kde-misc/kio-gdrive/kio-gdrive-1.2.6-r1.ebuild b/kde-misc/kio-gdrive/kio-gdrive-1.2.6-r1.ebuild |
195 |
new file mode 100644 |
196 |
index 00000000000..41e4f617d5c |
197 |
--- /dev/null |
198 |
+++ b/kde-misc/kio-gdrive/kio-gdrive-1.2.6-r1.ebuild |
199 |
@@ -0,0 +1,49 @@ |
200 |
+# Copyright 1999-2019 Gentoo Authors |
201 |
+# Distributed under the terms of the GNU General Public License v2 |
202 |
+ |
203 |
+EAPI=7 |
204 |
+ |
205 |
+KDE_APPS_MINIMAL=19.08.0 |
206 |
+KDE_HANDBOOK="forceoptional" |
207 |
+KDE_TEST="optional" |
208 |
+inherit kde5 |
209 |
+ |
210 |
+DESCRIPTION="KIO Slave for Google Drive service" |
211 |
+HOMEPAGE="https://phabricator.kde.org/project/profile/72/" |
212 |
+ |
213 |
+if [[ ${KDE_BUILD_TYPE} != live ]] ; then |
214 |
+ SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz" |
215 |
+ KEYWORDS="~amd64 ~x86" |
216 |
+fi |
217 |
+ |
218 |
+IUSE="+kaccounts" |
219 |
+ |
220 |
+COMMON_DEPEND=" |
221 |
+ $(add_frameworks_dep kcoreaddons) |
222 |
+ $(add_frameworks_dep ki18n) |
223 |
+ $(add_frameworks_dep kio) |
224 |
+ $(add_frameworks_dep knotifications) |
225 |
+ $(add_kdeapps_dep libkgapi) |
226 |
+ $(add_qt_dep qtwidgets) |
227 |
+ kaccounts? ( $(add_kdeapps_dep kaccounts-integration) ) |
228 |
+ !kaccounts? ( dev-libs/qtkeychain:=[qt5(+)] ) |
229 |
+" |
230 |
+DEPEND="${COMMON_DEPEND} |
231 |
+ $(add_qt_dep qtgui) |
232 |
+ $(add_qt_dep qtnetwork) |
233 |
+" |
234 |
+RDEPEND="${COMMON_DEPEND} |
235 |
+ kaccounts? ( $(add_kdeapps_dep kaccounts-providers) ) |
236 |
+" |
237 |
+BDEPEND="dev-util/intltool" |
238 |
+ |
239 |
+DOCS=( README.md ) |
240 |
+ |
241 |
+PATCHES=( "${FILESDIR}"/${P}-libkgapi-19.08-{1,2}.patch ) |
242 |
+ |
243 |
+src_configure() { |
244 |
+ local mycmakeargs=( |
245 |
+ $(cmake-utils_use_find_package kaccounts KAccounts) |
246 |
+ ) |
247 |
+ kde5_src_configure |
248 |
+} |