Improve tracking of whether Syncthing has been stopped manually
* Don't consider the proccess manually stopped by default; otherwise that's considered to be the case even though the launcher isn't used at all * Unset the service being manually stopped only when there's an actual state transition to running; otherwise we'd immediately unset the flag after manually stopping the service
This commit is contained in:
parent
ba0f60c6a8
commit
525b2c2f94
|
@ -106,7 +106,7 @@ SyncthingProcess *SyncthingProcess::s_mainInstance = nullptr;
|
|||
*/
|
||||
SyncthingProcess::SyncthingProcess(QObject *parent)
|
||||
: SyncthingProcessBase(parent)
|
||||
, m_manuallyStopped(true)
|
||||
, m_manuallyStopped(false)
|
||||
{
|
||||
m_killTimer.setInterval(3000);
|
||||
m_killTimer.setSingleShot(true);
|
||||
|
|
|
@ -492,10 +492,10 @@ void SyncthingService::handlePropertiesChanged(
|
|||
emit stateChanged(m_activeState, m_subState, m_activeSince);
|
||||
}
|
||||
const bool currentlyRunning = isRunning();
|
||||
if (currentlyRunning) {
|
||||
m_manuallyStopped = false;
|
||||
}
|
||||
if (wasRunningBefore != currentlyRunning) {
|
||||
if (currentlyRunning) {
|
||||
m_manuallyStopped = false;
|
||||
}
|
||||
emit runningChanged(currentlyRunning);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue