[neon/qt/qtbase/Neon/release] debian: Re-apply "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 958faffaf32dc64a0785a41361b1cd25343e47cf by Dmitry Shachnev.
Committed on 28/06/2021 at 15:42.
Pushed by jriddell into branch 'Neon/release'.

Re-apply "Remove the qmimeprovider.cpp part of mime_globs.diff."

While the reporter of #989744 managed to solve the issue, now we
also got bug #989255 where a comment says that reverting this part
fixes the issue.

Maybe it will also solve #990129 but that has not been tested yet.

This reverts commit 4f11833b4405f0239564fa597ae271f0c7cea7ab.

M  +5    -0    debian/changelog
M  +1    -35   debian/patches/mime_globs.diff

https://invent.kde.org/neon/qt/qtbase/commit/958faffaf32dc64a0785a41361b1cd25343e47cf

diff --git a/debian/changelog b/debian/changelog
index 9e8e4c8..542c10d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,11 @@ qtbase-opensource-src (5.15.2+dfsg-8) UNRELEASED; urgency=medium
   * Backport upstream patch to fix misplacement of placeholder text in
     QLineEdit with RTL content.
 
+  [ Dmitry Shachnev ]
+  * Remove the qmimeprovider.cpp part of mime_globs.diff. It is unrelated
+    to the original purpose of that patch, and causes various problems
+    (closes: #989255, #989744).
+
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Sat, 12 Jun 2021 20:32:46 +0300
 
 qtbase-opensource-src (5.15.2+dfsg-7) unstable; urgency=medium
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