Accepting request 899743 from KDE:Frameworks5
KDE Frameworks 5.83.0 OBS-URL: https://build.opensuse.org/request/show/899743 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kio?expand=0&rev=112
This commit is contained in:
commit
18c49f3322
@ -1,70 +0,0 @@
|
||||
From 542a74b8fa70fa530a436ee3222a9b0562155708 Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Marten <jjm@keelhaul.me.uk>
|
||||
Date: Sat, 8 May 2021 15:20:39 +0000
|
||||
Subject: [PATCH 1/3] MimeTypeFinderJob: Resolve symlinks for a local file
|
||||
|
||||
(cherry picked from commit e79da836c34fce66231e396c7215314d0eba51b4)
|
||||
---
|
||||
autotests/mimetypefinderjobtest.cpp | 18 +++++++++++++++++-
|
||||
src/core/mimetypefinderjob.cpp | 2 +-
|
||||
2 files changed, 18 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/autotests/mimetypefinderjobtest.cpp b/autotests/mimetypefinderjobtest.cpp
|
||||
index 72296b9b..f494ff3b 100644
|
||||
--- a/autotests/mimetypefinderjobtest.cpp
|
||||
+++ b/autotests/mimetypefinderjobtest.cpp
|
||||
@@ -48,6 +48,7 @@ void MimeTypeFinderJobTest::determineMimeType_data()
|
||||
QTest::newRow("text_file_no_extension") << "text/plain" << "srcfile";
|
||||
QTest::newRow("desktop_file") << "application/x-desktop" << "foo.desktop";
|
||||
QTest::newRow("script") << "application/x-shellscript" << "srcfile.sh";
|
||||
+ QTest::newRow("directory") << "inode/directory" << "srcdir";
|
||||
/* clang-format on */
|
||||
}
|
||||
|
||||
@@ -60,7 +61,12 @@ void MimeTypeFinderJobTest::determineMimeType()
|
||||
QTemporaryDir tempDir;
|
||||
const QString srcDir = tempDir.path();
|
||||
const QString srcFile = srcDir + QLatin1Char('/') + fileName;
|
||||
- createSrcFile(srcFile);
|
||||
+ if (mimeType == "inode/directory") {
|
||||
+ QVERIFY(QDir(srcDir).mkdir(fileName));
|
||||
+ } else {
|
||||
+ createSrcFile(srcFile);
|
||||
+ }
|
||||
+
|
||||
QVERIFY(QFile::exists(srcFile));
|
||||
const QUrl url = QUrl::fromLocalFile(srcFile);
|
||||
|
||||
@@ -68,6 +74,16 @@ void MimeTypeFinderJobTest::determineMimeType()
|
||||
KIO::MimeTypeFinderJob *job = new KIO::MimeTypeFinderJob(url, this);
|
||||
QVERIFY2(job->exec(), qPrintable(job->errorString()));
|
||||
QCOMPARE(job->mimeType(), mimeType);
|
||||
+
|
||||
+ // Check that the result is the same when accessing the source
|
||||
+ // file through a symbolic link (bug #436708)
|
||||
+ const QString srcLink = srcDir + QLatin1String("/link_") + fileName;
|
||||
+ QVERIFY(QFile::link(srcFile, srcLink));
|
||||
+ const QUrl linkUrl = QUrl::fromLocalFile(srcLink);
|
||||
+
|
||||
+ job = new KIO::MimeTypeFinderJob(linkUrl, this);
|
||||
+ QVERIFY2(job->exec(), qPrintable(job->errorString()));
|
||||
+ QCOMPARE(job->mimeType(), mimeType);
|
||||
}
|
||||
|
||||
void MimeTypeFinderJobTest::invalidUrl()
|
||||
diff --git a/src/core/mimetypefinderjob.cpp b/src/core/mimetypefinderjob.cpp
|
||||
index f5e50cdc..48fc8c28 100644
|
||||
--- a/src/core/mimetypefinderjob.cpp
|
||||
+++ b/src/core/mimetypefinderjob.cpp
|
||||
@@ -122,7 +122,7 @@ void KIO::MimeTypeFinderJobPrivate::statFile()
|
||||
{
|
||||
Q_ASSERT(m_mimeTypeName.isEmpty());
|
||||
|
||||
- KIO::StatJob *job = KIO::statDetails(m_url, KIO::StatJob::SourceSide, KIO::StatBasic, KIO::HideProgressInfo);
|
||||
+ KIO::StatJob *job = KIO::statDetails(m_url, KIO::StatJob::SourceSide, KIO::StatBasic | KIO::StatResolveSymlink, KIO::HideProgressInfo);
|
||||
if (!m_authPrompts) {
|
||||
job->addMetaData(QStringLiteral("no-auth-prompt"), QStringLiteral("true"));
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,53 +0,0 @@
|
||||
From e78b0cd47422869e980db633cbdc0c7cfcdd8dd8 Mon Sep 17 00:00:00 2001
|
||||
From: Ahmad Samir <a.samirh78@gmail.com>
|
||||
Date: Thu, 13 May 2021 17:02:52 +0200
|
||||
Subject: [PATCH 2/3] MimeTypeFinderJob: the StatJob details should include the
|
||||
mimetype
|
||||
|
||||
Apparently we forgot to specify that we want the UDS_MIME_TYPE field in
|
||||
the statFile() method (both when it lived in OpenUrlJob and when it was moved
|
||||
to MimeTypeFinderJob). And now there is a dedicated StatJob flag, StatMimeType,
|
||||
that we can use.
|
||||
|
||||
Not passing KIO::StatMimeType when creating the StatJob meant the code always
|
||||
used a get job to determine the mime type, which mean that e.g. opening an
|
||||
ISO file from Dolphin, which supposedly just needs to launch Ark, had the
|
||||
whole file read into memory, which means that opening a couple of ISO's and
|
||||
you're out of memory...
|
||||
|
||||
Thanks to sitter for doing a big chunk of the investigative work in the bug
|
||||
report.
|
||||
|
||||
CCBUG: 398908
|
||||
(cherry picked from commit c19876052ecec18a87a82f5950e8909e22e895ba)
|
||||
---
|
||||
src/core/mimetypefinderjob.cpp | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/core/mimetypefinderjob.cpp b/src/core/mimetypefinderjob.cpp
|
||||
index 48fc8c28..baca5869 100644
|
||||
--- a/src/core/mimetypefinderjob.cpp
|
||||
+++ b/src/core/mimetypefinderjob.cpp
|
||||
@@ -122,7 +122,9 @@ void KIO::MimeTypeFinderJobPrivate::statFile()
|
||||
{
|
||||
Q_ASSERT(m_mimeTypeName.isEmpty());
|
||||
|
||||
- KIO::StatJob *job = KIO::statDetails(m_url, KIO::StatJob::SourceSide, KIO::StatBasic | KIO::StatResolveSymlink, KIO::HideProgressInfo);
|
||||
+ static constexpr auto statFlags = KIO::StatBasic | KIO::StatResolveSymlink | KIO::StatMimeType;
|
||||
+
|
||||
+ KIO::StatJob *job = KIO::statDetails(m_url, KIO::StatJob::SourceSide, statFlags, KIO::HideProgressInfo);
|
||||
if (!m_authPrompts) {
|
||||
job->addMetaData(QStringLiteral("no-auth-prompt"), QStringLiteral("true"));
|
||||
}
|
||||
@@ -147,6 +149,8 @@ void KIO::MimeTypeFinderJobPrivate::statFile()
|
||||
|
||||
const KIO::UDSEntry entry = job->statResult();
|
||||
|
||||
+ qCDebug(KIO_CORE) << "UDSEntry from StatJob in MimeTypeFinderJob" << entry;
|
||||
+
|
||||
const QString localPath = entry.stringValue(KIO::UDSEntry::UDS_LOCAL_PATH);
|
||||
if (!localPath.isEmpty()) {
|
||||
m_url = QUrl::fromLocalFile(localPath);
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,63 +0,0 @@
|
||||
From dc5e968eefa4e6fafa0eecdfd36e7ea17b42fc08 Mon Sep 17 00:00:00 2001
|
||||
From: Ahmad Samir <a.samirh78@gmail.com>
|
||||
Date: Thu, 13 May 2021 23:03:57 +0200
|
||||
Subject: [PATCH 3/3] kio_file: pass the absolute path to
|
||||
QMimeDatabase::mimeTypeForFile()
|
||||
|
||||
Otherwise detecting the mime type based on the file content may fail and
|
||||
return application/octet-stream.
|
||||
|
||||
And pass the whole url to createUDSEntry(), less QFile::decodeName/encodeName()
|
||||
in the middle is better and less error prone.
|
||||
|
||||
Note that without this change a MimeTypeFinderJob could end up failing to
|
||||
find the mime type of a local file based on the file contents.
|
||||
|
||||
(cherry picked from commit c748d6987252fafc296cde9351b289ef734cf861)
|
||||
---
|
||||
src/ioslaves/file/file_unix.cpp | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.cpp
|
||||
index 99d46c8f..940e3cbc 100644
|
||||
--- a/src/ioslaves/file/file_unix.cpp
|
||||
+++ b/src/ioslaves/file/file_unix.cpp
|
||||
@@ -364,7 +364,7 @@ inline static time_t stat_mtime(QT_STATBUF &buf)
|
||||
}
|
||||
#endif
|
||||
|
||||
-static bool createUDSEntry(const QString &filename, const QByteArray &path, UDSEntry &entry, KIO::StatDetails details)
|
||||
+static bool createUDSEntry(const QString &filename, const QByteArray &path, UDSEntry &entry, KIO::StatDetails details, const QUrl &url)
|
||||
{
|
||||
assert(entry.count() == 0); // by contract :-)
|
||||
int entries = 0;
|
||||
@@ -539,7 +539,7 @@ static bool createUDSEntry(const QString &filename, const QByteArray &path, UDSE
|
||||
|
||||
if (details & KIO::StatMimeType) {
|
||||
QMimeDatabase db;
|
||||
- entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, db.mimeTypeForFile(filename).name());
|
||||
+ entry.fastInsert(KIO::UDSEntry::UDS_MIME_TYPE, db.mimeTypeForFile(url.toLocalFile()).name());
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1186,7 +1186,7 @@ void FileProtocol::listDir(const QUrl &url)
|
||||
listEntry(entry);
|
||||
|
||||
} else {
|
||||
- if (createUDSEntry(filename, QByteArray(ep->d_name), entry, details)) {
|
||||
+ if (createUDSEntry(filename, QByteArray(ep->d_name), entry, details, url)) {
|
||||
#if HAVE_SYS_XATTR_H
|
||||
if (isNtfsHidden(filename)) {
|
||||
bool ntfsHidden = true;
|
||||
@@ -1476,7 +1476,7 @@ void FileProtocol::stat(const QUrl &url)
|
||||
const KIO::StatDetails details = getStatDetails();
|
||||
|
||||
UDSEntry entry;
|
||||
- if (!createUDSEntry(url.fileName(), _path, entry, details)) {
|
||||
+ if (!createUDSEntry(url.fileName(), _path, entry, details, url)) {
|
||||
error(KIO::ERR_DOES_NOT_EXIST, path);
|
||||
return;
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cb970d0550054fd0bb0957de010b9ea73b2d89e8df725c0d8344320e82473144
|
||||
size 3330028
|
@ -1,11 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAABCgAdFiEEU+a0e0XOo+DVt0V3WNDuZIpIs7sFAmCULJcACgkQWNDuZIpI
|
||||
s7vHogf/bHYyqsRzdDBxqWWRo5/XPV0E1+mNXAHlKR9xDfELLmMtc6S47GGTPOiR
|
||||
wSFUhPtxE+9ORk3/OUTqRkyMIxjXq9bCrlQbLcPGgyGwXqjVQ9f8xL0pI7L72/4h
|
||||
pOfRVPU4Un5WJTtcWr+e1vjckXpH8K6Zxw/ZU9145/XAY33Q2D8daqS/KMhRa6ut
|
||||
UZIzzN6qIS7i51kwZTScbVX3PMfMr/fzMs2slAGQVpn9zgDN1uCwxoaD1I/4tubi
|
||||
Zph+I+qZfGKJ0b57dZMpBYfUaGKxqZ5lTElCVJ3Hq+41G7U9htAVUz8IrPdmjt8B
|
||||
GW6X+6wBeQlRQrTiOJzHgBpjfCgFYw==
|
||||
=+8we
|
||||
-----END PGP SIGNATURE-----
|
3
kio-5.83.0.tar.xz
Normal file
3
kio-5.83.0.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:faa5a519e0cccb7197a4025f4b267a7683b49ad9d03e730a57969f33072f51c1
|
||||
size 3187064
|
11
kio-5.83.0.tar.xz.sig
Normal file
11
kio-5.83.0.tar.xz.sig
Normal file
@ -0,0 +1,11 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAABCgAdFiEEU+a0e0XOo+DVt0V3WNDuZIpIs7sFAmDEb8IACgkQWNDuZIpI
|
||||
s7snxwf+OInHyw9s8PPQXVmytL57IMgbGPJ6OG+howKHOTXU+DrD9uwSFa0Ckyhd
|
||||
Ft292xO8+DsE3RNHSf0kJOPNJo/+Lf6X6DKVch7JelD73hQUPKsRxJxzq33QjRNL
|
||||
VnIHNMdAiLZZZTqql7ZQltFiyFq1DmOITxnnz8REiWGX4PEgjXpLU/EsHBMUq74O
|
||||
Mjbw38hXcrs9ZtzKBQXlqYZuWYPY/6VyFhMsMRaKcdDcPaoEsJ0N2y8j8bM2er1f
|
||||
FfFGHhM58/2nsQapkVJCHxiviZjeIJZeyUcoM8GkEaP4ZBgudmt3Q3Hj3LqLTOHT
|
||||
RasYDJb4NeMMN06riMh5M3KqLmwjiA==
|
||||
=+ptY
|
||||
-----END PGP SIGNATURE-----
|
19
kio.changes
19
kio.changes
@ -1,3 +1,22 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Jun 5 11:58:56 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
|
||||
|
||||
- Update to 5.83.0
|
||||
* New feature release
|
||||
* For more details please see:
|
||||
* https://kde.org/announcements/frameworks/5/5.83.0
|
||||
- Too many changes since 5.82.0, only listing bugfixes:
|
||||
* KOpenWithDialog: expand category on selection (kde#437885)
|
||||
* [kopenwithdialog] Show better error message when specifying a non-executable file (kde#437880)
|
||||
* [KCoreDirLister] Guard uiDelegate(), it might be null (kde#437153)
|
||||
* Allow selecting directories in KFileWidget (kde#419874)
|
||||
* When finding a job delegate extension, also try the uiDelegate() of its parents (kde#436049)
|
||||
* PreviewJob: Create a larger SHM when necessary (kde#430862)
|
||||
- Remove patches:
|
||||
* 0001-MimeTypeFinderJob-Resolve-symlinks-for-a-local-file.patch
|
||||
* 0002-MimeTypeFinderJob-the-StatJob-details-should-include.patch
|
||||
* 0003-kio_file-pass-the-absolute-path-to-QMimeDatabase-mim.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri May 14 13:00:14 UTC 2021 - Fabian Vogt <fabian@ritter-vogt.de>
|
||||
|
||||
|
11
kio.spec
11
kio.spec
@ -16,14 +16,14 @@
|
||||
#
|
||||
|
||||
|
||||
%define _tar_path 5.82
|
||||
%define _tar_path 5.83
|
||||
# Full KF5 version (e.g. 5.33.0)
|
||||
%{!?_kf5_version: %global _kf5_version %{version}}
|
||||
# Last major and minor KF5 version (e.g. 5.33)
|
||||
%{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')}
|
||||
%bcond_without lang
|
||||
Name: kio
|
||||
Version: 5.82.0
|
||||
Version: 5.83.0
|
||||
Release: 0
|
||||
Summary: Network transparent access to files and data
|
||||
License: LGPL-2.1-or-later
|
||||
@ -37,10 +37,6 @@ Source2: frameworks.keyring
|
||||
Source99: baselibs.conf
|
||||
# PATCH-FIX-OPENSUSE kio_help-fallback-to-kde4-docs.patch -- allow kio_help to see into kde4 documentation, needed especially for khelpcenter5
|
||||
Patch0: kio_help-fallback-to-kde4-docs.patch
|
||||
# PATCH-FIX-UPSTREAM
|
||||
Patch1: 0001-MimeTypeFinderJob-Resolve-symlinks-for-a-local-file.patch
|
||||
Patch2: 0002-MimeTypeFinderJob-the-StatJob-details-should-include.patch
|
||||
Patch3: 0003-kio_file-pass-the-absolute-path-to-QMimeDatabase-mim.patch
|
||||
BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: kf5-filesystem
|
||||
@ -228,14 +224,11 @@ Development files.
|
||||
%{_kf5_plugindir}/kf5/kiod/kioexecd.so
|
||||
%{_kf5_plugindir}/kf5/kiod/kpasswdserver.so
|
||||
%{_kf5_plugindir}/kf5/urifilters/
|
||||
%{_kf5_servicesdir}/cache.desktop
|
||||
%{_kf5_servicesdir}/cookies.desktop
|
||||
%{_kf5_servicesdir}/netpref.desktop
|
||||
%{_kf5_servicesdir}/proxy.desktop
|
||||
%{_kf5_servicesdir}/searchproviders/
|
||||
%{_kf5_servicesdir}/smb.desktop
|
||||
%{_kf5_servicesdir}/useragent.desktop
|
||||
%{_kf5_servicesdir}/useragentstrings/
|
||||
%{_kf5_servicesdir}/webshortcuts.desktop
|
||||
%{_kf5_servicetypesdir}/
|
||||
%{_kf5_sharedir}/dbus-1/services/org.kde.kcookiejar5.service
|
||||
|
Loading…
Reference in New Issue
Block a user