diff --git a/src/bin/patchmanager-daemon/patchmanagerobject.cpp b/src/bin/patchmanager-daemon/patchmanagerobject.cpp index 2b420bbaf..8039944db 100644 --- a/src/bin/patchmanager-daemon/patchmanagerobject.cpp +++ b/src/bin/patchmanager-daemon/patchmanagerobject.cpp @@ -313,6 +313,17 @@ void PatchManagerObject::setAppliedPatches(const QSet &patches) putSettings(QStringLiteral("applied"), QStringList(patches.toList())); } + +QSet PatchManagerObject::getLastGoodPatches() const +{ + return getSettings(QStringLiteral("lastknowngood"), QStringList()).toStringList().toSet(); +} + +void PatchManagerObject::setLastGoodPatches(const QSet &patches) +{ + putSettings(QStringLiteral("lastknowngood"), QStringList(patches.toList())); +} + QStringList PatchManagerObject::getMangleCandidates() { if (m_mangleCandidates.empty()) { @@ -540,6 +551,10 @@ void PatchManagerObject::doPrepareCacheRoot() emit m_adaptor->autoApplyingFinished(success); } + if (success) { + setLastGoodPatches(m_appliedPatches); + } + if (!success) { setAppliedPatches(m_appliedPatches); refreshPatchList(); diff --git a/src/bin/patchmanager-daemon/patchmanagerobject.h b/src/bin/patchmanager-daemon/patchmanagerobject.h index 272a550b7..7876d320b 100644 --- a/src/bin/patchmanager-daemon/patchmanagerobject.h +++ b/src/bin/patchmanager-daemon/patchmanagerobject.h @@ -216,6 +216,9 @@ private slots: QSet getAppliedPatches() const; void setAppliedPatches(const QSet &patches); + QSet getLastGoodPatches() const; + void setLastGoodPatches(const QSet &patches); + void getVersion(); void lateInitialize();