[neon/kde/kio/Neon/release] debian/patches: add patch requested by maintainer
Jonathan Riddell
null at kde.org
Fri May 14 13:07:09 BST 2021
Git commit bd6db7f5257def88461b42452a9cd79e9dc83882 by Jonathan Riddell.
Committed on 14/05/2021 at 12:06.
Pushed by jriddell into branch 'Neon/release'.
add patch requested by maintainer
A +46 -0 debian/patches/mimetype.diff
M +1 -0 debian/patches/series
https://invent.kde.org/neon/kde/kio/commit/bd6db7f5257def88461b42452a9cd79e9dc83882
diff --git a/debian/patches/mimetype.diff b/debian/patches/mimetype.diff
new file mode 100644
index 0000000..9c83b54
--- /dev/null
+++ b/debian/patches/mimetype.diff
@@ -0,0 +1,46 @@
+commit c19876052ecec18a87a82f5950e8909e22e895ba
+Author: Ahmad Samir <a.samirh78 at gmail.com>
+Date: Thu May 13 17:02:52 2021 +0200
+
+ 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
+
+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);
diff --git a/debian/patches/series b/debian/patches/series
index f49df91..7790801 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ Disable-flaky-test.patch
Disable-baloo-dependant-tests.patch
#Disable-flaky-test-1.patch
libexec_from_env.patch
+mimetype.diff
More information about the Neon-commits
mailing list