[Pkg-owncloud-commits] [owncloud-client] 44/70: Removed block parameter from terminateSync.

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat May 17 20:01:29 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 64f4d1b387ad91fd8a6374afa6d9a00a3853b8d6
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Tue May 13 13:39:00 2014 +0200

    Removed block parameter from terminateSync.
    
    Do not pretend to immediately terminate the sync but let csync
    finish planfully and free the mutex.
---
 src/mirall/accountsettings.cpp  |  4 ++--
 src/mirall/folder.cpp           | 12 ++++--------
 src/mirall/folder.h             |  4 +---
 src/mirall/folderman.cpp        |  5 +++--
 src/mirall/owncloudpropagator.h |  6 ++----
 5 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/src/mirall/accountsettings.cpp b/src/mirall/accountsettings.cpp
index 78e598a..7fff0bc 100644
--- a/src/mirall/accountsettings.cpp
+++ b/src/mirall/accountsettings.cpp
@@ -361,7 +361,7 @@ void AccountSettings::slotResetCurrentFolder()
         if( ret == QMessageBox::Yes ) {
             FolderMan *folderMan = FolderMan::instance();
             Folder *f = folderMan->folder(alias);
-            f->slotTerminateSync(true);
+            f->slotTerminateSync();
             f->wipe();
             folderMan->slotScheduleAllFolders();
         }
@@ -478,7 +478,7 @@ void AccountSettings::slotEnableCurrentFolder()
             // message box can return at any time while the thread keeps running,
             // so better check again after the user has responded.
             if ( f->isBusy() && terminate ) {
-                f->slotTerminateSync(false);
+                f->slotTerminateSync();
             }
 
             folderMan->slotEnableFolder( alias, !folderEnabled );
diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index ef93494..fd9d85a 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -466,7 +466,7 @@ void Folder::slotThreadTreeWalkResult(const SyncFileItemVector& items)
     _syncResult.setSyncFileItemVector(items);
 }
 
-void Folder::slotTerminateSync(bool block)
+void Folder::slotTerminateSync()
 {
     qDebug() << "folder " << alias() << " Terminating!";
 
@@ -476,14 +476,10 @@ void Folder::slotTerminateSync(bool block)
         // 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);
+        setSyncState(SyncResult::SyncAbortRequested);
+        return;
     }
-    setSyncEnabled(false);
 }
 
 // This removes the csync File database
diff --git a/src/mirall/folder.h b/src/mirall/folder.h
index 1918225..85fea62 100644
--- a/src/mirall/folder.h
+++ b/src/mirall/folder.h
@@ -148,10 +148,8 @@ public slots:
 
      /**
        * terminate the current sync run
-       *
-       * If block is true, this will block synchroniously for the sync thread to finish.
        */
-     void slotTerminateSync(bool block);
+     void slotTerminateSync();
 
      void slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool*);
 
diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp
index 1001d04..fbed51a 100644
--- a/src/mirall/folderman.cpp
+++ b/src/mirall/folderman.cpp
@@ -353,9 +353,10 @@ void FolderMan::terminateSyncProcess( const QString& alias )
     if( ! folderAlias.isEmpty() && _folderMap.contains(folderAlias) ) {
         Folder *f = _folderMap[folderAlias];
         if( f ) {
-            f->slotTerminateSync(true);
-            if(_currentSyncFolder == folderAlias )
+            f->slotTerminateSync();
+            if(_currentSyncFolder == folderAlias ) {
                 _currentSyncFolder.clear();
+            }
         }
     }
 }
diff --git a/src/mirall/owncloudpropagator.h b/src/mirall/owncloudpropagator.h
index 47e0959..cda037f 100644
--- a/src/mirall/owncloudpropagator.h
+++ b/src/mirall/owncloudpropagator.h
@@ -210,21 +210,19 @@ public:
     /* The number of currently active jobs */
     int _activeJobs;
 
-
     bool isInSharedDirectory(const QString& file);
 
-
     void abort() {
         _abortRequested.fetchAndStoreOrdered(true);
-        if (_rootJob)
+        if (_rootJob) {
             _rootJob->abort();
+        }
         emit finished();
     }
 
     // timeout in seconds
     static int httpTimeout();
 
-
 signals:
     void completed(const SyncFileItem &);
     void progress(const SyncFileItem&, quint64 bytes);

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