Commit 2405b765 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

PackageKit: Don't offer an empty system upgrade when there's no upgrades

There should at least be a package to upgrade to consider it.
parent 8d1bd6e1
......@@ -164,10 +164,11 @@ void PackageKitUpdater::prepare()
}
Q_ASSERT(!m_transaction);
if (useOfflineUpdates()) {
m_toUpgrade = { new SystemUpgrade(m_backend->upgradeablePackages(), m_backend) };
const auto candidates = m_backend->upgradeablePackages();
if (useOfflineUpdates() && !candidates.isEmpty()) {
m_toUpgrade = { new SystemUpgrade(candidates, m_backend) };
} else {
m_toUpgrade = m_backend->upgradeablePackages();
m_toUpgrade = candidates;
}
m_allUpgradeable = m_toUpgrade;
}
......
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