[Pkg-owncloud-commits] [owncloud-client] 74/115: Status Icons: Let FolderMan only write the folder config files.

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Aug 29 22:04: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 1245ed6f0650193874fef99224f006d0bb6087d6
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Tue Aug 19 14:03:41 2014 +0200

    Status Icons: Let FolderMan only write the folder config files.
    
    Remove the setSyncEnabled() call to individual folders which mistakenly
    set the folders to pause. Let the folders keep their pause state on their
    own.
    
    If FolderMan is set to be enabled emit a general refresh signal rather
    than one for each folder.
---
 src/mirall/folder.cpp    |  2 +-
 src/mirall/folderman.cpp | 14 +++++---------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index 6660d0a..fb296e4 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -482,7 +482,7 @@ void Folder::slotTerminateSync()
         // Do not display an error message, user knows his own actions.
         // _errors.append( tr("The CSync thread terminated.") );
         // _csyncError = true;
-        setSyncEnabled(false);
+        FolderMan::instance()->slotSetFolderPaused(alias(), true);
         setSyncState(SyncResult::SyncAbortRequested);
         return;
     }
diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp
index 11da864..99ea901 100644
--- a/src/mirall/folderman.cpp
+++ b/src/mirall/folderman.cpp
@@ -346,7 +346,7 @@ Folder* FolderMan::setupFolderFromConfigFile(const QString &file) {
     return folder;
 }
 
-void FolderMan::slotEnableFolder( const QString& alias, bool enable )
+void FolderMan::slotSetFolderPaused( const QString& alias, bool paused )
 {
     if( ! _folderMap.contains( alias ) ) {
       qDebug() << "!! Can not enable alias " << alias << ", can not be found in folderMap.";
@@ -355,7 +355,6 @@ void FolderMan::slotEnableFolder( const QString& alias, bool enable )
 
     Folder *f = _folderMap[alias];
     if( f ) {
-        f->setSyncEnabled(enable);
         slotScheduleSync(alias);
 
         // FIXME: Use MirallConfigFile
@@ -442,7 +441,6 @@ void FolderMan::slotScheduleSync( const QString& alias )
             }
         }
         _scheduleQueue.enqueue(alias);
-
     } else {
         qDebug() << " II> Sync for folder " << alias << " already scheduled, do not enqueue!";
     }
@@ -450,6 +448,8 @@ void FolderMan::slotScheduleSync( const QString& alias )
     QTimer::singleShot(500, this, SLOT(slotScheduleFolderSync()));
 }
 
+// only enable or disable foldermans will to schedule and do syncs.
+// this is not the same as Pause and Resume of folders.
 void FolderMan::setSyncEnabled( bool enabled )
 {
     if (!_syncEnabled && enabled && !_scheduleQueue.isEmpty()) {
@@ -457,12 +457,8 @@ void FolderMan::setSyncEnabled( bool enabled )
         QTimer::singleShot(200, this, SLOT(slotScheduleFolderSync()));
     }
     _syncEnabled = enabled;
-
-    foreach( Folder *f, _folderMap.values() ) {
-        if(f) { // check for f != 0. That can happen, do not remove the check!
-            f->setSyncEnabled(enabled && !_disabledFolders.contains(f));
-        }
-    }
+    // force a redraw in case the network connect status changed
+    emit( folderSyncStateChange(QString::null) );
 }
 
 /*

-- 
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