1 |
commit: abf5278fd06f3e1d88dd3e936c3cc1bc4136b455 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 25 09:45:37 2017 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 30 20:33:45 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abf5278f |
7 |
|
8 |
kde-frameworks/kio: Fix huge 'file has changed' annoyance |
9 |
|
10 |
Package-Manager: Portage-2.3.10, Repoman-2.3.3 |
11 |
|
12 |
kde-frameworks/kio/files/kio-5.38.0-kioexec.patch | 87 +++++++++++++++++++++++ |
13 |
kde-frameworks/kio/kio-5.38.0-r1.ebuild | 80 +++++++++++++++++++++ |
14 |
2 files changed, 167 insertions(+) |
15 |
|
16 |
diff --git a/kde-frameworks/kio/files/kio-5.38.0-kioexec.patch b/kde-frameworks/kio/files/kio-5.38.0-kioexec.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..1cf2a1bfb83 |
19 |
--- /dev/null |
20 |
+++ b/kde-frameworks/kio/files/kio-5.38.0-kioexec.patch |
21 |
@@ -0,0 +1,87 @@ |
22 |
+From c76c1486ec79e8a16329207e9b293eed1244adfb Mon Sep 17 00:00:00 2001 |
23 |
+From: Jonathan Marten <jjm@×××××××××××.uk> |
24 |
+Date: Mon, 25 Sep 2017 08:56:04 +0100 |
25 |
+Subject: kioexec: Watch the file when it has finished copying |
26 |
+ |
27 |
+To eliminate a spurious "The file has changed, do you want to upload |
28 |
+it?" dialogue. |
29 |
+ |
30 |
+BUG:384500 |
31 |
+ |
32 |
+Differential Revision: https://phabricator.kde.org/D7841 |
33 |
+--- |
34 |
+ src/kioexec/main.cpp | 49 +++++++++++++++++++++++++++---------------------- |
35 |
+ 1 file changed, 27 insertions(+), 22 deletions(-) |
36 |
+ |
37 |
+diff --git a/src/kioexec/main.cpp b/src/kioexec/main.cpp |
38 |
+index 6b0ec1d..615dfbf 100644 |
39 |
+--- a/src/kioexec/main.cpp |
40 |
++++ b/src/kioexec/main.cpp |
41 |
+@@ -118,11 +118,6 @@ KIOExec::KIOExec(const QStringList &args, bool tempFiles, const QString &suggest |
42 |
+ KIO::Job *job = KIO::file_copy(url, dest); |
43 |
+ jobList.append(job); |
44 |
+ |
45 |
+- // Tell kioexecd to watch the file for changes. |
46 |
+- OrgKdeKIOExecdInterface kioexecd(QStringLiteral("org.kde.kioexecd"), QStringLiteral("/modules/kioexecd"), QDBusConnection::sessionBus()); |
47 |
+- kioexecd.watch(file.path, file.url.toString()); |
48 |
+- mUseDaemon = !kioexecd.lastError().isValid(); |
49 |
+- |
50 |
+ connect(job, &KJob::result, this, &KIOExec::slotResult); |
51 |
+ } |
52 |
+ } |
53 |
+@@ -141,25 +136,35 @@ KIOExec::KIOExec(const QStringList &args, bool tempFiles, const QString &suggest |
54 |
+ |
55 |
+ void KIOExec::slotResult(KJob *job) |
56 |
+ { |
57 |
+- if (job && job->error()) { |
58 |
+- // That error dialog would be queued, i.e. not immediate... |
59 |
+- //job->showErrorDialog(); |
60 |
+- if ((job->error() != KIO::ERR_USER_CANCELED)) |
61 |
+- KMessageBox::error(nullptr, job->errorString()); |
62 |
+- |
63 |
+- QString path = static_cast<KIO::FileCopyJob*>(job)->destUrl().path(); |
64 |
+- |
65 |
+- QList<FileInfo>::Iterator it = fileList.begin(); |
66 |
+- for (; it != fileList.end(); ++it) { |
67 |
+- if (it->path == path) { |
68 |
+- break; |
69 |
++ if (job) { |
70 |
++ KIO::FileCopyJob *copyJob = static_cast<KIO::FileCopyJob *>(job); |
71 |
++ const QString path = copyJob->destUrl().path(); |
72 |
++ |
73 |
++ if (job->error()) { |
74 |
++ // That error dialog would be queued, i.e. not immediate... |
75 |
++ //job->showErrorDialog(); |
76 |
++ if ((job->error() != KIO::ERR_USER_CANCELED)) |
77 |
++ KMessageBox::error(nullptr, job->errorString()); |
78 |
++ |
79 |
++ auto it = std::find_if(fileList.begin(), fileList.end(), |
80 |
++ [&path](const FileInfo &i) { return (i.path == path); }); |
81 |
++ if (it != fileList.end()) { |
82 |
++ fileList.erase(it); |
83 |
++ } else { |
84 |
++ qDebug() << path << " not found in list"; |
85 |
+ } |
86 |
+ } |
87 |
+- |
88 |
+- if (it != fileList.end()) { |
89 |
+- fileList.erase(it); |
90 |
+- } else { |
91 |
+- qDebug() << path << " not found in list"; |
92 |
++ else |
93 |
++ { |
94 |
++ // Tell kioexecd to watch the file for changes. |
95 |
++ const QString dest = copyJob->srcUrl().toString(); |
96 |
++ qDebug() << "Telling kioexecd to watch path" << path << "dest" << dest; |
97 |
++ OrgKdeKIOExecdInterface kioexecd(QStringLiteral("org.kde.kioexecd"), QStringLiteral("/modules/kioexecd"), QDBusConnection::sessionBus()); |
98 |
++ kioexecd.watch(path, dest); |
99 |
++ mUseDaemon = !kioexecd.lastError().isValid(); |
100 |
++ if (!mUseDaemon) { |
101 |
++ qDebug() << "Not using kioexecd"; |
102 |
++ } |
103 |
+ } |
104 |
+ } |
105 |
+ |
106 |
+-- |
107 |
+cgit v0.11.2 |
108 |
+ |
109 |
|
110 |
diff --git a/kde-frameworks/kio/kio-5.38.0-r1.ebuild b/kde-frameworks/kio/kio-5.38.0-r1.ebuild |
111 |
new file mode 100644 |
112 |
index 00000000000..d20326004df |
113 |
--- /dev/null |
114 |
+++ b/kde-frameworks/kio/kio-5.38.0-r1.ebuild |
115 |
@@ -0,0 +1,80 @@ |
116 |
+# Copyright 1999-2017 Gentoo Foundation |
117 |
+# Distributed under the terms of the GNU General Public License v2 |
118 |
+ |
119 |
+EAPI=6 |
120 |
+ |
121 |
+KDE_TEST="forceoptional" |
122 |
+VIRTUALX_REQUIRED="test" |
123 |
+inherit kde5 |
124 |
+ |
125 |
+DESCRIPTION="Framework providing transparent file and data management" |
126 |
+LICENSE="LGPL-2+" |
127 |
+KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
128 |
+IUSE="acl +handbook kerberos +kwallet X" |
129 |
+ |
130 |
+RDEPEND=" |
131 |
+ $(add_frameworks_dep karchive) |
132 |
+ $(add_frameworks_dep kbookmarks) |
133 |
+ $(add_frameworks_dep kcodecs) |
134 |
+ $(add_frameworks_dep kcompletion) |
135 |
+ $(add_frameworks_dep kconfig) |
136 |
+ $(add_frameworks_dep kconfigwidgets) |
137 |
+ $(add_frameworks_dep kcoreaddons) |
138 |
+ $(add_frameworks_dep kdbusaddons) |
139 |
+ $(add_frameworks_dep ki18n) |
140 |
+ $(add_frameworks_dep kiconthemes) |
141 |
+ $(add_frameworks_dep kitemviews) |
142 |
+ $(add_frameworks_dep kjobwidgets) |
143 |
+ $(add_frameworks_dep knotifications) |
144 |
+ $(add_frameworks_dep kservice) |
145 |
+ $(add_frameworks_dep ktextwidgets) |
146 |
+ $(add_frameworks_dep kwidgetsaddons) |
147 |
+ $(add_frameworks_dep kwindowsystem) |
148 |
+ $(add_frameworks_dep kxmlgui) |
149 |
+ $(add_frameworks_dep solid) |
150 |
+ $(add_qt_dep qtdbus) |
151 |
+ $(add_qt_dep qtgui) |
152 |
+ $(add_qt_dep qtnetwork 'ssl') |
153 |
+ $(add_qt_dep qtscript) |
154 |
+ $(add_qt_dep qtwidgets) |
155 |
+ $(add_qt_dep qtxml) |
156 |
+ dev-libs/libxml2 |
157 |
+ dev-libs/libxslt |
158 |
+ acl? ( |
159 |
+ sys-apps/attr |
160 |
+ virtual/acl |
161 |
+ ) |
162 |
+ kerberos? ( virtual/krb5 ) |
163 |
+ kwallet? ( $(add_frameworks_dep kwallet) ) |
164 |
+ X? ( $(add_qt_dep qtx11extras) ) |
165 |
+" |
166 |
+DEPEND="${RDEPEND} |
167 |
+ $(add_qt_dep qtconcurrent) |
168 |
+ handbook? ( $(add_frameworks_dep kdoctools) ) |
169 |
+ test? ( sys-libs/zlib ) |
170 |
+ X? ( |
171 |
+ x11-libs/libX11 |
172 |
+ x11-libs/libXrender |
173 |
+ x11-proto/xproto |
174 |
+ ) |
175 |
+" |
176 |
+PDEPEND=" |
177 |
+ $(add_frameworks_dep kded) |
178 |
+" |
179 |
+ |
180 |
+# tests hang |
181 |
+RESTRICT+=" test" |
182 |
+ |
183 |
+PATCHES=( "${FILESDIR}/${P}-kioexec.patch" ) |
184 |
+ |
185 |
+src_configure() { |
186 |
+ local mycmakeargs=( |
187 |
+ $(cmake-utils_use_find_package acl ACL) |
188 |
+ $(cmake-utils_use_find_package handbook KF5DocTools) |
189 |
+ $(cmake-utils_use_find_package kerberos GSSAPI) |
190 |
+ $(cmake-utils_use_find_package kwallet KF5Wallet) |
191 |
+ $(cmake-utils_use_find_package X X11) |
192 |
+ ) |
193 |
+ |
194 |
+ kde5_src_configure |
195 |
+} |