Avoid duplicates in the available backends list

If a generator can open multiple mime types that match the same file, avoid showing a backend chooser dialog with multiple instances of the same
backend

REVIEW: 129791
BUG: 374650
This commit is contained in:
Antonio Rojas 2017-01-08 19:38:42 +01:00
parent bb84cbe079
commit f3f077e1a6

View file

@ -2196,11 +2196,11 @@ KPluginMetaData DocumentPrivate::generatorForMimeType(const QMimeType& type, QWi
foreach (const QString& supported, md.mimeTypes())
{
QMimeType mimeType = mimeDatabase.mimeTypeForName(supported);
if (mimeType == type) {
if (mimeType == type && !exactMatches.contains(md)) {
exactMatches << md;
}
if (type.inherits(supported))
if (type.inherits(supported) && !offers.contains(md))
{
offers << md;
}