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

Revert "packagekit: stop supporting searches by package name"

This reverts commit f8ae0a4c.

It's too short notice for 5.21, we'll see how we can make this change
more bearable for 5.22
parent f8ae0a4c
......@@ -510,7 +510,23 @@ ResultsStream* PackageKitBackend::search(const AbstractResourcesBackend::Filters
const auto resources = kFilter<QVector<AbstractResource*>>(resourcesByPackageNames<QVector<AbstractResource*>>(ids), [](AbstractResource* res){ return !qobject_cast<PackageKitResource*>(res)->extendsItself(); });
stream->setResources(resources);
}
stream->finish();
PackageKit::Transaction * tArch = PackageKit::Daemon::resolve(filter.search, 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) {
getPackagesFinished();
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()); }));
}
}
stream->finish();
}, 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