Commit 3efdec4a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Fwupd: don't return every resource if we don't know about the URL we're given

parent 4b1c5509
......@@ -628,12 +628,11 @@ int FwupdBackend::updatesCount() const
ResultsStream* FwupdBackend::search(const AbstractResourcesBackend::Filters& filter)
{
QVector<AbstractResource*> ret;
if(!filter.resourceUrl.isEmpty() && filter.resourceUrl.scheme() == QLatin1String("fwupd"))
{
if(filter.resourceUrl.scheme() == QLatin1String("fwupd")) {
return findResourceByPackageName(filter.resourceUrl);
}
else
{
} else if (!filter.resourceUrl.isEmpty()) {
return new ResultsStream(QStringLiteral("FwupdStream-void"), {});
} else {
foreach(AbstractResource* r, m_resources)
{
if(r->name().contains(filter.search, Qt::CaseInsensitive) || r->comment().contains(filter.search, Qt::CaseInsensitive))
......
Markdown is supported
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