From c41195f65d22455432da195c90e32c0056be5819 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sun, 26 Nov 2017 14:06:05 +0100 Subject: frameworks/kio: fix directory creation in dolphin and plasma Qt 5.9.3 breaks KIO::mkpath() which results in the inability to create directories in Dolphin and Plasma Folder View. This patch (included in future Frameworks 5.41) fixes the regression. --- kde/build/kio | 1 + kde/patch/kio.patch | 5 +++ kde/patch/kio/kio_fix_url_setpath.patch | 65 +++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 kde/build/kio create mode 100644 kde/patch/kio/kio_fix_url_setpath.patch diff --git a/kde/build/kio b/kde/build/kio new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/kde/build/kio @@ -0,0 +1 @@ +2 diff --git a/kde/patch/kio.patch b/kde/patch/kio.patch index 5d87cba..b518946 100644 --- a/kde/patch/kio.patch +++ b/kde/patch/kio.patch @@ -7,3 +7,8 @@ # to kio (kf5 based) to make service menus visible in dolphin (kf5 based): #cat $CWD/patch/kio/kio_dolphin_servicemenus.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } +# Qt >= 5.9.3 breaks creation of folders in kio, which affects e.g. +# Dolphin and Plasma Folder View. +# Fixed in KIO 5.41: +cat $CWD/patch/kio/kio_fix_url_setpath.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } + diff --git a/kde/patch/kio/kio_fix_url_setpath.patch b/kde/patch/kio/kio_fix_url_setpath.patch new file mode 100644 index 0000000..d9cf740 --- /dev/null +++ b/kde/patch/kio/kio_fix_url_setpath.patch @@ -0,0 +1,65 @@ +From 2353119aae8f03565bc7779ed1d597d266f5afda Mon Sep 17 00:00:00 2001 +From: Elvis Angelaccio +Date: Thu, 16 Nov 2017 10:41:19 +0100 +Subject: 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 bff46ca..a177805 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 { +-- +cgit v0.11.2 + -- cgit v1.2.3