Commit 2fc8f0c3 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

De-duplicate redundant updates

Count packages, not resources.

BUG: 389108
parent 36643a92
......@@ -262,7 +262,6 @@ int UpdateModel::toUpdateCount() const
int UpdateModel::totalUpdatesCount() const
{
int ret = 0;
QSet<QString> packages;
foreach (UpdateItem* item, m_updateItems) {
......
......@@ -421,7 +421,17 @@ bool PackageKitBackend::hasSecurityUpdates() const
int PackageKitBackend::updatesCount() const
{
return upgradeablePackages().count();
int ret = 0;
QSet<QString> packages;
for(auto res: upgradeablePackages()) {
const auto packageName = res->packageName();
if (packages.contains(packageName)) {
continue;
}
packages.insert(packageName);
ret += 1;
}
return ret;
}
Transaction* PackageKitBackend::installApplication(AbstractResource* app, const AddonList& addons)
......
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