summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-03-01 15:14:34 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-03-02 14:52:59 +0000
commit52a5ffb505f737836d69e512c50bb6aff0b75f02 (patch)
tree7e00e89a971b4822d208a9b89bc2d750847f28da /src/corelib
parentacba844c6ba0d72c6f37d8cbee8b343c23b05de1 (diff)
QMimeBinaryProvider::loadMimeTypePrivate(): Make name check case insensitive.
RFC 2045 mandates case-insensitive comparison for MIME type and subtype. Fixes numerous warnings appearing when dumping the database on Ubuntu 14.04.1 LTS: Got name "application/vnd.ms-excel.sheet.binary.macroenabled.12" in file "application/vnd.ms-excel.sheet.binary.macroEnabled.12.xml" expected "application/vnd.ms-excel.sheet.binary.macroEnabled.12" Got name "application/vnd.ms-excel.sheet.macroenabled.12" in file "application/vnd.ms-excel.sheet.macroEnabled.12.xml" expected "application/vnd.ms-excel.sheet.macroEnabled.12" Got name "application/vnd.ms-excel.template.macroenabled.12" in file "application/vnd.ms-excel.template.macroEnabled.12.xml" expected "application/vnd.ms-excel.template.macroEnabled.12" Got name "application/vnd.ms-powerpoint.presentation.macroenabled.12" in file "application/vnd.ms-powerpoint.presentation.macroEnabled.12.xml" expected "application/vnd.ms-powerpoint.presentation.macroEnabled.12" Got name "application/vnd.ms-powerpoint.template.macroenabled.12" in file "application/vnd.ms-powerpoint.template.macroEnabled.12.xml" expected "application/vnd.ms-powerpoint.template.macroEnabled.12" Got name "application/vnd.ms-word.document.macroenabled.12" in file "application/vnd.ms-word.document.macroEnabled.12.xml" expected "application/vnd.ms-word.document.macroEnabled.12" Got name "application/vnd.ms-word.template.macroenabled.12" in file "application/vnd.ms-word.template.macroEnabled.12.xml" expected "application/vnd.ms-word.template.macroEnabled.12" Change-Id: Ie2a427069024080302a95ac46a456288787542c4 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 917c29b8d6..0c64db4d48 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -591,9 +591,8 @@ void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
const QStringRef name = xml.attributes().value(QLatin1String("type"));
if (name.isEmpty())
continue;
- if (name != data.name) {
+ if (name.compare(data.name, Qt::CaseInsensitive))
qWarning() << "Got name" << name << "in file" << file << "expected" << data.name;
- }
while (xml.readNextStartElement()) {
const QStringRef tag = xml.name();