summaryrefslogtreecommitdiff
path: root/kde-frameworks/kio/files/kio-5.82.0-MimeTypeFinderJob-memleak-2.patch
diff options
context:
space:
mode:
Diffstat (limited to 'kde-frameworks/kio/files/kio-5.82.0-MimeTypeFinderJob-memleak-2.patch')
-rw-r--r--kde-frameworks/kio/files/kio-5.82.0-MimeTypeFinderJob-memleak-2.patch61
1 files changed, 0 insertions, 61 deletions
diff --git a/kde-frameworks/kio/files/kio-5.82.0-MimeTypeFinderJob-memleak-2.patch b/kde-frameworks/kio/files/kio-5.82.0-MimeTypeFinderJob-memleak-2.patch
deleted file mode 100644
index bf3ff50802f6..000000000000
--- a/kde-frameworks/kio/files/kio-5.82.0-MimeTypeFinderJob-memleak-2.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From c748d6987252fafc296cde9351b289ef734cf861 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] 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.
----
- 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 99d46c8f1..940e3cbc4 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;
- }
---
-GitLab
-