void SyncSystem::connected() { setSyncState(e_Idle); m_BytesInTransit = 0; if(m_RestartSyncOnReconnect) { m_RestartSyncOnReconnect = false; QTimer::singleShot(1000, this, SLOT(slotStartSync())); } }
void Folder::slotTerminateSync() { qDebug() << "folder " << alias() << " Terminating!"; if( _engine ) { _engine->abort(); // Do not display an error message, user knows his own actions. // _errors.append( tr("The CSync thread terminated.") ); // _csyncError = true; setSyncState(SyncResult::SyncAbortRequested); } }
void Folder::setSyncPaused( bool paused ) { _paused = paused; if( !paused ) { // qDebug() << "Syncing enabled on folder " << name(); } 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. setSyncState(SyncResult::Paused); } }
void Folder::slotTerminateSync(bool block) { qDebug() << "folder " << alias() << " Terminating!"; if( _engine ) { _engine->abort(); // Do not display an error message, user knows his own actions. // _errors.append( tr("The CSync thread terminated.") ); // _csyncError = true; if (!block) { setSyncState(SyncResult::SyncAbortRequested); return; } slotSyncFinished(); } setSyncEnabled(false); }
////////////////////////////////////////////////////////////////////////// /// Do a full nodewatching and scan stop. /// /// Returns the sync system state to idle. /// Loops over all FileSystemWatchers, stops, disconnects all signals and /// waits for the thread to stop. ////////////////////////////////////////////////////////////////////////// void SyncSystem::slotStopSync() { setSyncState(e_Idle); stopFullSync(); stopNodeWatching(); }