Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit aeacfe2b authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Fwupd: better variable scope

parent 3efdec4a
......@@ -627,17 +627,16 @@ int FwupdBackend::updatesCount() const
ResultsStream* FwupdBackend::search(const AbstractResourcesBackend::Filters& filter)
{
QVector<AbstractResource*> ret;
if(filter.resourceUrl.scheme() == QLatin1String("fwupd")) {
return findResourceByPackageName(filter.resourceUrl);
} 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))
ret += r;
}
return new ResultsStream(QStringLiteral("FwupdStream-void"), {});
}
QVector<AbstractResource*> ret;
foreach(AbstractResource* r, m_resources) {
if(r->name().contains(filter.search, Qt::CaseInsensitive) || r->comment().contains(filter.search, Qt::CaseInsensitive))
ret += r;
}
return new ResultsStream(QStringLiteral("FwupdStream"), ret);
}
......
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