summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimeprovider.cpp
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2020-03-26 11:09:24 +0200
committerDavid Faure <david.faure@kdab.com>2020-06-01 13:36:05 +0200
commit4f1ebf666e36020c501e6d3b20d70320b45ab2ec (patch)
tree2993a066475042a3bc4abf2026dde4ac85d99e55 /src/corelib/mimetypes/qmimeprovider.cpp
parentb0294bb1c74ae3f5aabb873435788200da988908 (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/qmimeprovider.cpp')
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 83574a40f0..e8e81e65ab 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -306,7 +306,7 @@ bool QMimeBinaryProvider::matchSuffixTree(QMimeGlobMatchResult &result, QMimeBin
const bool caseSensitive = flagsAndWeight & 0x100;
if (caseSensitiveCheck || !caseSensitive) {
result.addMatch(QLatin1String(mimeType), weight,
- QLatin1Char('*') + fileName.midRef(charPos + 1));
+ QLatin1Char('*') + fileName.midRef(charPos + 1), fileName.size() - charPos - 2);
success = true;
}
}