Skip to content

Commit

Permalink
if auto applying succeded, save a known good state
Browse files Browse the repository at this point in the history
  • Loading branch information
nephros committed May 26, 2023
1 parent 4a245ee commit 777d43d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/bin/patchmanager-daemon/patchmanagerobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,17 @@ void PatchManagerObject::setAppliedPatches(const QSet<QString> &patches)
putSettings(QStringLiteral("applied"), QStringList(patches.toList()));
}


QSet<QString> PatchManagerObject::getLastGoodPatches() const
{
return getSettings(QStringLiteral("lastknowngood"), QStringList()).toStringList().toSet();
}

void PatchManagerObject::setLastGoodPatches(const QSet<QString> &patches)
{
putSettings(QStringLiteral("lastknowngood"), QStringList(patches.toList()));
}

QStringList PatchManagerObject::getMangleCandidates()
{
if (m_mangleCandidates.empty()) {
Expand Down Expand Up @@ -540,6 +551,10 @@ void PatchManagerObject::doPrepareCacheRoot()
emit m_adaptor->autoApplyingFinished(success);
}

if (success) {
setLastGoodPatches(m_appliedPatches);
}

if (!success) {
setAppliedPatches(m_appliedPatches);
refreshPatchList();
Expand Down
3 changes: 3 additions & 0 deletions src/bin/patchmanager-daemon/patchmanagerobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ private slots:
QSet<QString> getAppliedPatches() const;
void setAppliedPatches(const QSet<QString> &patches);

QSet<QString> getLastGoodPatches() const;
void setLastGoodPatches(const QSet<QString> &patches);

void getVersion();

void lateInitialize();
Expand Down

0 comments on commit 777d43d

Please sign in to comment.