Commit 71435f22 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

pk: Don't call the size function as it triggers a details fetch

We are only checking the previous size to see if it needs to emit a
change, we were fetching twice in practice.

CCBUG: 432657


(cherry picked from commit 76780c71)
parent 6440e8f7
...@@ -198,7 +198,7 @@ void PackageKitResource::setDetails(const PackageKit::Details & details) ...@@ -198,7 +198,7 @@ void PackageKitResource::setDetails(const PackageKit::Details & details)
if (m_details != details) { if (m_details != details) {
const auto oldState = state(); const auto oldState = state();
const auto oldSize= size(); const auto oldSize = m_details.size();
m_details = details; m_details = details;
if (oldState != state()) if (oldState != state())
...@@ -207,7 +207,7 @@ void PackageKitResource::setDetails(const PackageKit::Details & details) ...@@ -207,7 +207,7 @@ void PackageKitResource::setDetails(const PackageKit::Details & details)
if (!backend()->isFetching()) if (!backend()->isFetching())
Q_EMIT backend()->resourcesChanged(this, {"size", "homepage", "license"}); Q_EMIT backend()->resourcesChanged(this, {"size", "homepage", "license"});
if (oldSize != size()) { if (oldSize != uint(size())) {
Q_EMIT sizeChanged(); Q_EMIT sizeChanged();
} }
} }
......
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