summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimeglobpattern.cpp
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2013-07-28 20:03:57 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-03 14:44:12 +0200
commit672fcbe9c6586e909513c91f5b36ad9a83a0ef1c (patch)
tree94f9a721ecb15a4bc59793b8a7953cfa1114bf10 /src/corelib/mimetypes/qmimeglobpattern.cpp
parentbe8974633c4f812227db256dae6fa249f60c61d1 (diff)
QMimeDatabase: Fix handling of duplicate mimetype definitions (2/2).
7721c3d27c6a fixed the case where two similar definitions are in the same directory. This commit fixes the case where two similar definitions are in different directories, both in the search path (GenericDataLocation). If the file extension gives us the same mimetype twice, there's no conflict, i.e. no reason to fallback to determination from contents. Change-Id: I72c56004b6d5e88964159e53ec160ce8b06c2264 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/mimetypes/qmimeglobpattern.cpp')
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/mimetypes/qmimeglobpattern.cpp b/src/corelib/mimetypes/qmimeglobpattern.cpp
index 96798cabcd..530d3de4a2 100644
--- a/src/corelib/mimetypes/qmimeglobpattern.cpp
+++ b/src/corelib/mimetypes/qmimeglobpattern.cpp
@@ -77,9 +77,11 @@ void QMimeGlobMatchResult::addMatch(const QString &mimeType, int weight, const Q
m_matchingPatternLength = pattern.length();
m_weight = weight;
}
- m_matchingMimeTypes.append(mimeType);
- if (pattern.startsWith(QLatin1String("*.")))
- m_foundSuffix = pattern.mid(2);
+ if (!m_matchingMimeTypes.contains(mimeType)) {
+ m_matchingMimeTypes.append(mimeType);
+ if (pattern.startsWith(QLatin1String("*.")))
+ m_foundSuffix = pattern.mid(2);
+ }
}
/*!