[Pkg-owncloud-commits] [owncloud-client] 08/219: folder: Make sure not to pol the server if the account is disconnected

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:03 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 2356601bb36c442ca340b1bb0912fd42ec0e7c7a
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Tue Aug 26 16:23:19 2014 +0200

    folder: Make sure not to pol the server if the account is disconnected
    
    Fixes #2108
---
 src/mirall/folder.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index 2d6be37..81bd84b 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -220,11 +220,11 @@ bool Folder::syncPaused() const
   return _paused;
 }
 
-void Folder::setSyncPaused( bool doit )
+void Folder::setSyncPaused( bool paused )
 {
-  _paused = doit;
+  _paused = paused;
 
-  if( doit ) {
+  if( !paused ) {
       // qDebug() << "Syncing enabled on folder " << name();
   } else {
       // do not stop or start the watcher here, that is done internally by
@@ -255,6 +255,11 @@ void Folder::slotPollTimerTimeout()
 {
     qDebug() << "* Polling" << alias() << "for changes. (time since last sync:" << (_timeSinceLastSync.elapsed() / 1000) << "s)";
 
+    if (_paused || AccountManager::instance()->account()->state() != Account::Connected) {
+        qDebug() << "Not syncing.  :" << _paused << AccountManager::instance()->account()->state();
+        return;
+    }
+
     if (quint64(_timeSinceLastSync.elapsed()) > MirallConfigFile().forceSyncInterval() ||
             !(_syncResult.status() == SyncResult::Success ||_syncResult.status() == SyncResult::Problem)) {
         qDebug() << "** Force Sync now, state is " << _syncResult.statusString();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list