This commit is contained in:
Rex Dieter 2017-12-04 10:55:58 -06:00
parent 437380364f
commit a780c4b7fd
7 changed files with 7 additions and 257 deletions

10
.gitignore vendored
View File

@ -1,9 +1 @@
/kio-5.32.0.tar.xz
/kio-5.33.0.tar.xz
/kio-5.34.0.tar.xz
/kio-5.35.0.tar.xz
/kio-5.36.0.tar.xz
/kio-5.37.0.tar.xz
/kio-5.38.0.tar.xz
/kio-5.39.0.tar.xz
/kio-5.40.0.tar.xz
/kio-5.41.0.tar.xz

View File

@ -1,65 +0,0 @@
From 2353119aae8f03565bc7779ed1d597d266f5afda Mon Sep 17 00:00:00 2001
From: Elvis Angelaccio <elvis.angelaccio@kde.org>
Date: Thu, 16 Nov 2017 10:41:19 +0100
Subject: [PATCH 09/24] Fix KIO::mkpath with qtbase 5.10 beta 4
Summary:
The latest Qt 5.10 beta includes [1] which breaks a bunch of unit tests,
since `url.setPath("//foo")` will now result in an invalid (empty) QUrl.
This patch fixes the KIO::mkpath() case.
[1]: http://code.qt.io/cgit/qt/qtbase.git/commit/?id=f62768d046528636789f901ac79e2cfa1843a7b7
Test Plan:
* I can now create folders from dolphin and plasma.
* fileundomanagertest and mkpathjobtest no longer fail
Reviewers: #frameworks, dfaure
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D8836
---
src/core/mkpathjob.cpp | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/core/mkpathjob.cpp b/src/core/mkpathjob.cpp
index bff46cad..a1778056 100644
--- a/src/core/mkpathjob.cpp
+++ b/src/core/mkpathjob.cpp
@@ -43,8 +43,13 @@ public:
m_url.setPath(QStringLiteral("/"));
int i = 0;
for (; i < basePathComponents.count() && i < m_pathComponents.count(); ++i) {
- if (m_pathComponents.at(i) == basePathComponents.at(i)) {
- m_url.setPath(m_url.path() + '/' + m_pathComponents.at(i));
+ const QString pathComponent = m_pathComponents.at(i);
+ if (pathComponent == basePathComponents.at(i)) {
+ if (m_url.path() == QLatin1Char('/')) {
+ m_url.setPath(m_url.path() + pathComponent);
+ } else {
+ m_url.setPath(m_url.path() + '/' + pathComponent);
+ }
} else {
break;
}
@@ -57,7 +62,13 @@ public:
if (m_url.isLocalFile()) {
i = 0;
for (; i < m_pathComponents.count(); ++i) {
- QString testDir = m_url.toLocalFile() + '/' + m_pathComponents.at(i);
+ const QString localFile = m_url.toLocalFile();
+ QString testDir;
+ if (localFile == QLatin1Char('/')) {
+ testDir = localFile + m_pathComponents.at(i);
+ } else {
+ testDir = localFile + '/' + m_pathComponents.at(i);
+ }
if (QFileInfo(testDir).isDir()) {
m_url.setPath(testDir);
} else {
--
2.14.3

View File

@ -1,38 +0,0 @@
From 05938a167dd4190014d800bb02446e2779a9b3b2 Mon Sep 17 00:00:00 2001
From: Elvis Angelaccio <elvis.angelaccio@kde.org>
Date: Thu, 16 Nov 2017 12:06:41 +0100
Subject: [PATCH 10/24] Fix testtrash with qtbase 5.10 beta 4
Summary:
Same fix as in D8836, this time for testtrash.
Test Plan:
Run testtrash.
Reviewed By: dfaure
Differential Revision: https://phabricator.kde.org/D8837
---
src/core/listjob.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/core/listjob.cpp b/src/core/listjob.cpp
index 4b7b5102..54a422a2 100644
--- a/src/core/listjob.cpp
+++ b/src/core/listjob.cpp
@@ -117,7 +117,11 @@ void ListJobPrivate::slotListEntries(const KIO::UDSEntryList &list)
itemURL = q->url();
filename = entry.stringValue(KIO::UDSEntry::UDS_NAME);
Q_ASSERT(!filename.isEmpty()); // we'll recurse forever otherwise :)
- itemURL.setPath(itemURL.path() + '/' + filename);
+ if (itemURL.path() == QLatin1Char('/')) {
+ itemURL.setPath(itemURL.path() + filename);
+ } else {
+ itemURL.setPath(itemURL.path() + '/' + filename);
+ }
}
if (entry.isDir() && !entry.isLink()) {
--
2.14.3

View File

@ -1,57 +0,0 @@
From a208dc70c9a5abdd9d2682b4f3453708d4d6cdf3 Mon Sep 17 00:00:00 2001
From: Elvis Angelaccio <elvis.angelaccio@kde.org>
Date: Thu, 16 Nov 2017 12:46:17 +0100
Subject: [PATCH 11/24] Fix build on FreeBSD
Summary: I broke the build on FreeBSD, this patch should fix it.
Reviewers: adridg, dfaure
Subscribers: #frameworks
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D8841
---
src/core/listjob.cpp | 2 +-
src/core/mkpathjob.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/core/listjob.cpp b/src/core/listjob.cpp
index 54a422a2..d91ea4c1 100644
--- a/src/core/listjob.cpp
+++ b/src/core/listjob.cpp
@@ -117,7 +117,7 @@ void ListJobPrivate::slotListEntries(const KIO::UDSEntryList &list)
itemURL = q->url();
filename = entry.stringValue(KIO::UDSEntry::UDS_NAME);
Q_ASSERT(!filename.isEmpty()); // we'll recurse forever otherwise :)
- if (itemURL.path() == QLatin1Char('/')) {
+ if (itemURL.path() == QLatin1String("/")) {
itemURL.setPath(itemURL.path() + filename);
} else {
itemURL.setPath(itemURL.path() + '/' + filename);
diff --git a/src/core/mkpathjob.cpp b/src/core/mkpathjob.cpp
index a1778056..c77a9fe9 100644
--- a/src/core/mkpathjob.cpp
+++ b/src/core/mkpathjob.cpp
@@ -45,7 +45,7 @@ public:
for (; i < basePathComponents.count() && i < m_pathComponents.count(); ++i) {
const QString pathComponent = m_pathComponents.at(i);
if (pathComponent == basePathComponents.at(i)) {
- if (m_url.path() == QLatin1Char('/')) {
+ if (m_url.path() == QLatin1String("/")) {
m_url.setPath(m_url.path() + pathComponent);
} else {
m_url.setPath(m_url.path() + '/' + pathComponent);
@@ -64,7 +64,7 @@ public:
for (; i < m_pathComponents.count(); ++i) {
const QString localFile = m_url.toLocalFile();
QString testDir;
- if (localFile == QLatin1Char('/')) {
+ if (localFile == QLatin1String("/")) {
testDir = localFile + m_pathComponents.at(i);
} else {
testDir = localFile + '/' + m_pathComponents.at(i);
--
2.14.3

View File

@ -1,81 +0,0 @@
From 298c0e734efdd8a7b66a531959e3fb5357a6495d Mon Sep 17 00:00:00 2001
From: Eike Hein <hein@kde.org>
Date: Tue, 28 Nov 2017 19:42:46 +0900
Subject: [PATCH 24/24] Fix creating a directory via KNewFileMenu+KIO::mkpath
on Qt 5.9.3+
Summary:
f62768d04652 in qtbase.git introduced a behavior change in QUrl
causing it to reject URLs with a path of "//foo" (note the double
slash) as invalid.
Both KNewFileMenu and KIO::mkpath contained code following this
pattern:
url.path() + '/' + name
This is a bad mix with forwarding slaves like kio_desktop, which
translate a top-level path of / to some other URL:
(desktop:)/ + / + foo = //foo
This patch addresses the two instances of this by wrapping the
string building in QDir::cleanPath, which I think is the shortest
and most readable way to go.
2353119aae8f in kio.git (D8836) was another commit fixing fallout
from this Qt change. Is unlikely this patch will be the last one.
I suspect many other variations of this problem lurk about the
codebase.
BUG:387073
Reviewers: dfaure, thiago, elvisangelaccio
Subscribers: #frameworks
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D9029
---
src/core/mkpathjob.cpp | 3 ++-
src/filewidgets/knewfilemenu.cpp | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/core/mkpathjob.cpp b/src/core/mkpathjob.cpp
index c77a9fe9..f67a489d 100644
--- a/src/core/mkpathjob.cpp
+++ b/src/core/mkpathjob.cpp
@@ -25,6 +25,7 @@
#include "mkdirjob.h"
#include <QTimer>
#include <QDebug>
+#include <QDir>
#include <QFileInfo>
using namespace KIO;
@@ -123,7 +124,7 @@ void MkpathJobPrivate::slotStart()
}
if (m_pathIterator != m_pathComponents.constEnd()) {
- m_url.setPath(m_url.path() + '/' + *m_pathIterator);
+ m_url.setPath(QDir::cleanPath(m_url.path() + '/' + *m_pathIterator));
KIO::Job* job = KIO::mkdir(m_url);
q->addSubjob(job);
q->setProcessedAmount(KJob::Directories, q->processedAmount(KJob::Directories) + 1);
diff --git a/src/filewidgets/knewfilemenu.cpp b/src/filewidgets/knewfilemenu.cpp
index 023eebd4..98c98526 100644
--- a/src/filewidgets/knewfilemenu.cpp
+++ b/src/filewidgets/knewfilemenu.cpp
@@ -855,7 +855,7 @@ void KNewFileMenuPrivate::_k_slotCreateDirectory(bool writeHiddenDir)
}
}
url = baseUrl;
- url.setPath(url.path() + '/' + name);
+ url.setPath(QDir::cleanPath(url.path() + '/' + name));
}
}
--
2.14.3

View File

@ -1,8 +1,8 @@
%global framework kio
Name: kf5-%{framework}
Version: 5.40.0
Release: 3%{?dist}
Version: 5.41.0
Release: 1%{?dist}
Summary: KDE Frameworks 5 Tier 3 solution for filesystem abstraction
License: GPLv2+ and MIT and BSD
@ -18,10 +18,6 @@ URL: https://cgit.kde.org/%{framework}.git
Source0: http://download.kde.org/%{stable}/frameworks/%{versiondir}/%{framework}-%{version}.tar.xz
## upstream patches
Patch9: 0009-Fix-KIO-mkpath-with-qtbase-5.10-beta-4.patch
Patch10: 0010-Fix-testtrash-with-qtbase-5.10-beta-4.patch
Patch11: 0011-Fix-build-on-FreeBSD.patch
Patch24: 0024-Fix-creating-a-directory-via-KNewFileMenu-KIO-mkpath.patch
## upstreamable patches
# revert part of https://cgit.kde.org/kio.git/commit/src/core/slave.cpp?id=e2a4517f099d809bd53c6a10769ebfddc0f28a8b
@ -275,6 +271,9 @@ fi
%changelog
* Mon Dec 04 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.41.0-1
- 5.41.0
* Tue Nov 28 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.40.0-3
- pull in upstream fixes for Qt 5.9.3/5.10-beta changes

View File

@ -1 +1 @@
SHA512 (kio-5.40.0.tar.xz) = e35a7fed3c38f91c056d5ac04b4839ebbf199e4509187e997d6d8a217175a9dc442c7beacccf333ec092c0d110f8f008144293364006888f25b570d697c10bed
SHA512 (kio-5.41.0.tar.xz) = 8f7072bf6268bf07c0c1266cdbee58aacdf43721d193aaa7574c683a4339de3d9701977c8bdd604f301d11393b8d2031e0b90e9ccc42a2c5e62050f41bc04216