[neon/qt/qtbase/Neon/release] debian: Remove the qmimeprovider.cpp part of mime_globs.diff.
Dmitry Shachnev
null at kde.org
Thu May 5 10:59:24 BST 2022
Git commit 75c663da63357893beddeccfe53abff68a0ec568 by Dmitry Shachnev.
Committed on 12/06/2021 at 17:35.
Pushed by jriddell into branch 'Neon/release'.
Remove the qmimeprovider.cpp part of mime_globs.diff.
It is unrelated to the original purpose of that patch, and causes
problems with all/allfiles MIME type.
Closes: #989744.
M +4 -0 debian/changelog
M +1 -35 debian/patches/mime_globs.diff
https://invent.kde.org/neon/qt/qtbase/commit/75c663da63357893beddeccfe53abff68a0ec568
diff --git a/debian/changelog b/debian/changelog
index 33450fd..a743fba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
qtbase-opensource-src (5.15.2+dfsg-8) UNRELEASED; urgency=medium
+ [ Dmitry Shachnev ]
+ * Remove the qmimeprovider.cpp part of mime_globs.diff. It is unrelated to
+ the original purpose of that patch, and causes problems with all/allfiles
+ MIME type (closes: #989744).
-- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org> Sat, 12 Jun 2021 20:32:46 +0300
diff --git a/debian/patches/mime_globs.diff b/debian/patches/mime_globs.diff
index d5bb271..1c66eba 100644
--- a/debian/patches/mime_globs.diff
+++ b/debian/patches/mime_globs.diff
@@ -2,14 +2,8 @@ Description: adjust QMimeDatabase implementation
When multiple globs match, and the result from magic sniffing is
unrelated to any of those globs, globs have priority and one of them
should be picked up.
- .
- This change also optimizes QMimeBinaryProvider::addFileNameMatches
- to have the same logic as xdgmime for glob matching:
- literals > extensions > other globs
- As soon as one category matches, we can stop there.
- This makes no difference in the overall results, in practice.
Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0cbbba2aa5b47224
-Last-Update: 2021-05-18
+Last-Update: 2021-06-12
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -55,31 +49,3 @@ Last-Update: 2021-05-18
m_knownSuffixLength = knownSuffixLength;
}
}
---- a/src/corelib/mimetypes/qmimeprovider.cpp
-+++ b/src/corelib/mimetypes/qmimeprovider.cpp
-@@ -244,15 +244,18 @@ void QMimeBinaryProvider::addFileNameMat
- const QString lowerFileName = fileName.toLower();
- // Check literals (e.g. "Makefile")
- matchGlobList(result, m_cacheFile, m_cacheFile->getUint32(PosLiteralListOffset), fileName);
-- // Check complex globs (e.g. "callgrind.out[0-9]*")
-- matchGlobList(result, m_cacheFile, m_cacheFile->getUint32(PosGlobListOffset), fileName);
- // Check the very common *.txt cases with the suffix tree
-- const int reverseSuffixTreeOffset = m_cacheFile->getUint32(PosReverseSuffixTreeOffset);
-- const int numRoots = m_cacheFile->getUint32(reverseSuffixTreeOffset);
-- const int firstRootOffset = m_cacheFile->getUint32(reverseSuffixTreeOffset + 4);
-- matchSuffixTree(result, m_cacheFile, numRoots, firstRootOffset, lowerFileName, lowerFileName.length() - 1, false);
-+ if (result.m_matchingMimeTypes.isEmpty()) {
-+ const int reverseSuffixTreeOffset = m_cacheFile->getUint32(PosReverseSuffixTreeOffset);
-+ const int numRoots = m_cacheFile->getUint32(reverseSuffixTreeOffset);
-+ const int firstRootOffset = m_cacheFile->getUint32(reverseSuffixTreeOffset + 4);
-+ matchSuffixTree(result, m_cacheFile, numRoots, firstRootOffset, lowerFileName, lowerFileName.length() - 1, false);
-+ if (result.m_matchingMimeTypes.isEmpty())
-+ matchSuffixTree(result, m_cacheFile, numRoots, firstRootOffset, fileName, fileName.length() - 1, true);
-+ }
-+ // Check complex globs (e.g. "callgrind.out[0-9]*" or "README*")
- if (result.m_matchingMimeTypes.isEmpty())
-- matchSuffixTree(result, m_cacheFile, numRoots, firstRootOffset, fileName, fileName.length() - 1, true);
-+ matchGlobList(result, m_cacheFile, m_cacheFile->getUint32(PosGlobListOffset), fileName);
- }
-
- void QMimeBinaryProvider::matchGlobList(QMimeGlobMatchResult &result, CacheFile *cacheFile, int off, const QString &fileName)
More information about the Neon-commits
mailing list