From 84c9910da9533b9b08fc5a40f693d6763152b331 Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Sun, 8 Jan 2017 19:38:42 +0100 Subject: [PATCH] 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 --- core/document.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/document.cpp b/core/document.cpp index 19526627b..8a6a0fd2b 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -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; }