summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimedatabase.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/qmimedatabase.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/qmimedatabase.cpp')
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index d65f1bdebd..974ca36a40 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -638,7 +638,8 @@ QList<QMimeType> QMimeDatabase::mimeTypesForFileName(const QString &fileName) co
QString QMimeDatabase::suffixForFileName(const QString &fileName) const
{
QMutexLocker locker(&d->mutex);
- return d->findByFileName(QFileInfo(fileName).fileName()).m_foundSuffix;
+ const int suffixLength = d->findByFileName(QFileInfo(fileName).fileName()).m_knownSuffixLength;
+ return fileName.right(suffixLength);
}
/*!