Commit f8ae0a4c authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

packagekit: stop supporting searches by package name

Back when we started supporting appstream a lot of poorly maintained
apps didn't appear in the databases, this made using Discover
unbearable, hence adding the feature of searching the package name from
the query.

Despite being against our vision, it made sense back then. Nowadays
applications should already have adopted AppStream in a way or another
and this shouldn't apply anymore.

BUG: 432690

(cherry picked from commit d1263d12)
parent 4358ecbd
......@@ -510,23 +510,7 @@ ResultsStream* PackageKitBackend::search(const AbstractResourcesBackend::Filters
const auto resources = kFilter<QVector<AbstractResource*>>(resourcesByPackageNames<QVector<AbstractResource*>>(ids), [](AbstractResource* res){ return !qobject_cast<PackageKitResource*>(res)->extendsItself(); });
PackageKit::Transaction * tArch = PackageKit::Daemon::resolve(, PackageKit::Transaction::FilterArch);
connect(tArch, &PackageKit::Transaction::package, this, &PackageKitBackend::addPackageArch);
connect(tArch, &PackageKit::Transaction::package, stream, [stream](PackageKit::Transaction::Info /*info*/, const QString &packageId){
stream->setProperty("packageId", packageId);
connect(tArch, &PackageKit::Transaction::finished, stream, [stream, ids, this](PackageKit::Transaction::Exit status) {
if (status == PackageKit::Transaction::Exit::ExitSuccess) {
const auto packageId = stream->property("packageId");
if (!packageId.isNull()) {
const auto res = resourcesByPackageNames<QVector<AbstractResource*>>({PackageKit::Daemon::packageName(packageId.toString())});
stream->setResources(kFilter<QVector<AbstractResource*>>(res, [ids](AbstractResource* res){ return !ids.contains(res->appstreamId()); }));
}, Qt::QueuedConnection);
runWhenInitialized(f, stream);
return stream;
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