Commit a9926cae authored by Alexander Lohnau's avatar Alexander Lohnau 💬 Committed by Nate Graham
Browse files

appstream runner: De-duplicate results from multiple sources

BUG: 448619
FIXED-IN: 5.24.1


(cherry picked from commit d2f948ec)
parent 12f8228d
Pipeline #135848 passed with stage
in 7 minutes and 14 seconds
......@@ -18,6 +18,8 @@
#include <KLocalizedString>
#include <KSycoca>
#include <set>
#include "debug.h"
K_PLUGIN_CLASS_WITH_JSON(InstallerRunner, "plasma-runner-appstream.json")
......@@ -87,6 +89,7 @@ void InstallerRunner::match(Plasma::RunnerContext &context)
}
}
std::set<QString> uniqueIds;
const auto components = findComponentsByString(context.query()).mid(0, 3);
for (const AppStream::Component &component : components) {
......@@ -118,6 +121,10 @@ void InstallerRunner::match(Plasma::RunnerContext &context)
if (!servicesFound.isEmpty())
continue;
const auto [_, inserted] = uniqueIds.insert(componentId);
if (!inserted) {
continue;
}
Plasma::QueryMatch match(this);
match.setType(Plasma::QueryMatch::PossibleMatch);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment