diff options
author | David Faure <david.faure@kdab.com> | 2020-03-26 11:09:24 +0200 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2020-06-01 13:36:05 +0200 |
commit | 4f1ebf666e36020c501e6d3b20d70320b45ab2ec (patch) | |
tree | 2993a066475042a3bc4abf2026dde4ac85d99e55 /src/corelib/mimetypes/qmimeglobpattern_p.h | |
parent | b0294bb1c74ae3f5aabb873435788200da988908 (diff) |
QMimeType::suffixForFileName shouldn't lowercase the file suffix
It was returning a lowercased suffix because it was extracting it from
the pattern (*.txt) rather than from the filename ("README.TXT").
This broke expectations on the application side, since this method is
documented to return a suffix from the given filename.
Ref: https://bugs.kde.org/show_bug.cgi?id=402388
Change-Id: I7dae13db31280249d3f592fa9592c4067804e22d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/mimetypes/qmimeglobpattern_p.h')
-rw-r--r-- | src/corelib/mimetypes/qmimeglobpattern_p.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/corelib/mimetypes/qmimeglobpattern_p.h b/src/corelib/mimetypes/qmimeglobpattern_p.h index cf27d6ab30..49f145e8db 100644 --- a/src/corelib/mimetypes/qmimeglobpattern_p.h +++ b/src/corelib/mimetypes/qmimeglobpattern_p.h @@ -62,17 +62,13 @@ QT_BEGIN_NAMESPACE struct QMimeGlobMatchResult { - QMimeGlobMatchResult() - : m_weight(0), m_matchingPatternLength(0) - {} - - void addMatch(const QString &mimeType, int weight, const QString &pattern); + void addMatch(const QString &mimeType, int weight, const QString &pattern, int knownSuffixLength = 0); QStringList m_matchingMimeTypes; // only those with highest weight QStringList m_allMatchingMimeTypes; - int m_weight; - int m_matchingPatternLength; - QString m_foundSuffix; + int m_weight = 0; + int m_matchingPatternLength = 0; + int m_knownSuffixLength = 0; }; class QMimeGlobPattern |