Force update available to false if an update is running
parent
746aa66e4d
commit
de3b7b4204
|
|
@ -243,7 +243,7 @@ void SnapdControl::onLoadRunningChangesFinished()
|
||||||
QString changeStatus = changeMap.value("status").toString();
|
QString changeStatus = changeMap.value("status").toString();
|
||||||
QString changeSummary = changeMap.value("summary").toString();
|
QString changeSummary = changeMap.value("summary").toString();
|
||||||
|
|
||||||
// If there is a change kind "doing" or "Do"
|
// If there is a change kind "Doing" or "Do"
|
||||||
if ( (changeStatus == "Doing" || changeStatus == "Do") && m_updateChangeKinds.contains(changeKind)) {
|
if ( (changeStatus == "Doing" || changeStatus == "Do") && m_updateChangeKinds.contains(changeKind)) {
|
||||||
// Set the status of the current running change
|
// Set the status of the current running change
|
||||||
updateRunning = true;
|
updateRunning = true;
|
||||||
|
|
@ -251,10 +251,16 @@ void SnapdControl::onLoadRunningChangesFinished()
|
||||||
updateStatus = changeSummary;
|
updateStatus = changeSummary;
|
||||||
qCDebug(dcSnapd()).noquote() << "Current change:" << changeId << (changeReady ? "ready" : "not ready") << changeStatus << changeKind << changeSummary;
|
qCDebug(dcSnapd()).noquote() << "Current change:" << changeId << (changeReady ? "ready" : "not ready") << changeStatus << changeKind << changeSummary;
|
||||||
|
|
||||||
|
// TODO: calculate the overall percentage of the update process (Do + Doing / Done)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If currently an update is running, lets force update available to false if set to true
|
||||||
|
if (updateRunning && device()->stateValue(snapdControlUpdateAvailableStateTypeId).toBool()) {
|
||||||
|
device()->setStateValue(snapdControlUpdateAvailableStateTypeId, false);
|
||||||
|
}
|
||||||
|
|
||||||
device()->setStateValue(snapdControlUpdateRunningStateTypeId, updateRunning);
|
device()->setStateValue(snapdControlUpdateRunningStateTypeId, updateRunning);
|
||||||
device()->setStateValue(snapdControlStatusStateTypeId, updateStatus);
|
device()->setStateValue(snapdControlStatusStateTypeId, updateStatus);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue