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

pk: small code simplifcation

Don't connect to a signal from the same object that we just emit once.
parent 5b8d1ba4
...@@ -31,10 +31,6 @@ PackageKitResource::PackageKitResource(QString packageName, QString summary, Pac ...@@ -31,10 +31,6 @@ PackageKitResource::PackageKitResource(QString packageName, QString summary, Pac
, m_name(std::move(packageName)) , m_name(std::move(packageName))
{ {
setObjectName(m_name); setObjectName(m_name);
connect(this, &PackageKitResource::dependenciesFound, this, [this](const QJsonObject &obj) {
setDependenciesCount(obj.size());
});
} }
QString PackageKitResource::name() const QString PackageKitResource::name() const
...@@ -361,6 +357,7 @@ void PackageKitResource::fetchDependencies() ...@@ -361,6 +357,7 @@ void PackageKitResource::fetchDependencies()
}); });
connect(trans, &PackageKit::Transaction::finished, this, [this, packageDependencies](PackageKit::Transaction::Exit /*status*/) { connect(trans, &PackageKit::Transaction::finished, this, [this, packageDependencies](PackageKit::Transaction::Exit /*status*/) {
Q_EMIT dependenciesFound(*packageDependencies); Q_EMIT dependenciesFound(*packageDependencies);
setDependenciesCount(packageDependencies->size());
}); });
} }
......
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