From e9d870282e8386f91df4eddfd37536a3b293aadf Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 1 May 2018 10:46:54 +0200 Subject: [PATCH] reorder state changes in snapd plugin --- snapd/snapdcontrol.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/snapd/snapdcontrol.cpp b/snapd/snapdcontrol.cpp index 56ce102b..41ccab4f 100644 --- a/snapd/snapdcontrol.cpp +++ b/snapd/snapdcontrol.cpp @@ -256,13 +256,16 @@ void SnapdControl::onLoadRunningChangesFinished() } } + device()->setStateValue(snapdControlUpdateRunningStateTypeId, updateRunning); + device()->setStateValue(snapdControlStatusStateTypeId, updateStatus); + // If currently an update is running, lets force update available to false if set to true + // keep this below the setStateValue for updateRunning or we might have intermediate states indicating + // no update running and none available if (updateRunning && device()->stateValue(snapdControlUpdateAvailableStateTypeId).toBool()) { device()->setStateValue(snapdControlUpdateAvailableStateTypeId, false); } - device()->setStateValue(snapdControlUpdateRunningStateTypeId, updateRunning); - device()->setStateValue(snapdControlStatusStateTypeId, updateStatus); } void SnapdControl::onConfigureRefreshScheduleFinished()