mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Do not en- or disable the watcher in setSyncEnabled.
The watcher is handled through the start and stop sync hooks in the folder class. Even if the the folder is disabled and the watcher fires, the folder does not schedule because it checks first if the folder is enabled.
This commit is contained in:
parent
287ec2f3df
commit
80332fb6ab
1 changed files with 4 additions and 4 deletions
|
@ -196,15 +196,14 @@ bool Folder::syncEnabled() const
|
|||
void Folder::setSyncEnabled( bool doit )
|
||||
{
|
||||
_enabled = doit;
|
||||
_watcher->setEventsEnabled( doit );
|
||||
|
||||
qDebug() << "setSyncEnabled - ############################ " << doit;
|
||||
if( doit ) {
|
||||
// undefined until next sync
|
||||
_syncResult.setStatus( SyncResult::NotYetStarted);
|
||||
_syncResult.clearErrors();
|
||||
evaluateSync( QStringList() );
|
||||
} else {
|
||||
// do not stop or start the watcher here, that is done internally by
|
||||
// folder class. Even if the watcher fires, the folder does not
|
||||
// schedule itself because it checks the var. _enabled before.
|
||||
_pollTimer.stop();
|
||||
}
|
||||
}
|
||||
|
@ -227,6 +226,7 @@ void Folder::evaluateSync(const QStringList &/*pathList*/)
|
|||
}
|
||||
|
||||
_syncResult.setStatus( SyncResult::NotYetStarted );
|
||||
_syncResult.clearErrors();
|
||||
emit scheduleToSync( alias() );
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue