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

PK: Use the stream to store the information rather than the transaction

BUG: 386992
parent 2eb1148f
......@@ -418,13 +418,13 @@ ResultsStream* PackageKitBackend::search(const AbstractResourcesBackend::Filters
PackageKit::Transaction * tArch = PackageKit::Daemon::resolve(filter.search, PackageKit::Transaction::FilterArch);
connect(tArch, &PackageKit::Transaction::package, this, &PackageKitBackend::addPackageArch);
connect(tArch, &PackageKit::Transaction::package, this, [tArch](PackageKit::Transaction::Info /*info*/, const QString &packageId){
tArch->setProperty("packageId", packageId);
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, tArch, ids, this](PackageKit::Transaction::Exit status) {
connect(tArch, &PackageKit::Transaction::finished, stream, [stream, ids, this](PackageKit::Transaction::Exit status) {
getPackagesFinished();
if (status == PackageKit::Transaction::Exit::ExitSuccess) {
const auto packageId = tArch->property("packageId");
const auto packageId = stream->property("packageId");
if (!packageId.isNull()) {
const auto res = resourcesByPackageNames<QVector<AbstractResource*>>({PackageKit::Daemon::packageName(packageId.toString())});
stream->resourcesFound(kFilter<QVector<AbstractResource*>>(res, [ids](AbstractResource* res){ return !ids.contains(res->appstreamId()); }));
......
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