summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2018-12-13 04:05:01 +0100
committerAleix Pol <[email protected]>2018-12-13 04:05:01 +0100
commitc980ddf6e3680c8bbe31b0e91d6ef0e99f1d8274 (patch)
tree9a98d8b6a3b8da47e67fae951a900f049da89aee
parent012bd024d631332fa4a4fb7e0ff77374577f61fd (diff)
pk: Fix state update logic on aptcc
-rw-r--r--libdiscover/backends/PackageKitBackend/PKTransaction.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/libdiscover/backends/PackageKitBackend/PKTransaction.cpp b/libdiscover/backends/PackageKitBackend/PKTransaction.cpp
index c643d9b..51e5d79 100644
--- a/libdiscover/backends/PackageKitBackend/PKTransaction.cpp
+++ b/libdiscover/backends/PackageKitBackend/PKTransaction.cpp
@@ -233,7 +233,12 @@ void PKTransaction::submitResolve()
const auto backend = qobject_cast<PackageKitBackend*>(resource()->backend());
QStringList needResolving;
for(auto it = m_newPackageStates.constBegin(), itEnd = m_newPackageStates.constEnd(); it != itEnd; ++it) {
- if (it.key() != PackageKit::Transaction::InfoInstalled && it.key() != PackageKit::Transaction::InfoAvailable)
+ auto state = it.key();
+ if (state == PackageKit::Transaction::InfoInstalling)
+ state = PackageKit::Transaction::InfoInstalled;
+ if (state == PackageKit::Transaction::InfoRemoving)
+ state = PackageKit::Transaction::InfoAvailable;
+ if (state != PackageKit::Transaction::InfoInstalled && state != PackageKit::Transaction::InfoAvailable)
continue;
foreach(const auto &pkgid, it.value()) {
@@ -241,7 +246,7 @@ void PKTransaction::submitResolve()
for(auto res: resources) {
auto r = qobject_cast<PackageKitResource*>(res);
r->clearPackageIds();
- r->addPackageId(it.key(), pkgid, true);
+ r->addPackageId(state, pkgid, true);
}
}
}