[Pkg-owncloud-commits] [owncloud-client] 66/219: Folders: Signout should not switch folders to paused state. #2112

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 11 14:43:10 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 da945336477fbe8a9302f323804d578cb62c510c
Author: Christian Kamm <kamm at incasoftware.de>
Date:   Thu Sep 4 10:12:54 2014 +0200

    Folders: Signout should not switch folders to paused state. #2112
    
    On signout, syncs that are running in folders are aborted. That used to
    also switch the state of these folders to 'paused'. To fix that, aborts
    that are caused by user actions no longer change the folder paused
    state.
    
    Aborts due to errors should still pause folders! Otherwise we'd try
    resyncing them even though there was an error.
---
 src/mirall/accountsettings.cpp     | 4 ++--
 src/mirall/folder.cpp              | 8 ++++++--
 src/mirall/folder.h                | 1 +
 src/mirall/folderman.cpp           | 8 --------
 src/mirall/folderman.h             | 6 +++++-
 src/mirall/selectivesyncdialog.cpp | 2 +-
 6 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/mirall/accountsettings.cpp b/src/mirall/accountsettings.cpp
index fc0c56a..c25d891 100644
--- a/src/mirall/accountsettings.cpp
+++ b/src/mirall/accountsettings.cpp
@@ -383,7 +383,7 @@ void AccountSettings::slotResetCurrentFolder()
         if( ret == QMessageBox::Yes ) {
             FolderMan *folderMan = FolderMan::instance();
             Folder *f = folderMan->folder(alias);
-            f->slotTerminateSync();
+            f->slotTerminateAndPauseSync();
             f->wipe();
             folderMan->slotScheduleAllFolders();
         }
@@ -499,7 +499,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();
+            f->slotTerminateAndPauseSync();
         }
         f->setSyncPaused(!currentlyPaused); // toggle the pause setting
         folderMan->slotSetFolderPaused( alias, !currentlyPaused );
diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp
index 914a342..c59e2fa 100644
--- a/src/mirall/folder.cpp
+++ b/src/mirall/folder.cpp
@@ -496,12 +496,16 @@ void Folder::slotTerminateSync()
         // Do not display an error message, user knows his own actions.
         // _errors.append( tr("The CSync thread terminated.") );
         // _csyncError = true;
-        FolderMan::instance()->slotSetFolderPaused(alias(), true);
         setSyncState(SyncResult::SyncAbortRequested);
-        return;
     }
 }
 
+void Folder::slotTerminateAndPauseSync()
+{
+    slotTerminateSync();
+    FolderMan::instance()->slotSetFolderPaused(alias(), true);
+}
+
 // This removes the csync File database
 // This is needed to provide a clean startup again in case another
 // local folder is synced to the same ownCloud.
diff --git a/src/mirall/folder.h b/src/mirall/folder.h
index b5eff8e..0c25580 100644
--- a/src/mirall/folder.h
+++ b/src/mirall/folder.h
@@ -138,6 +138,7 @@ public slots:
        * terminate the current sync run
        */
      void slotTerminateSync();
+     void slotTerminateAndPauseSync();
 
      void slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool*);
 
diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp
index 2cea122..61d768c 100644
--- a/src/mirall/folderman.cpp
+++ b/src/mirall/folderman.cpp
@@ -226,14 +226,6 @@ bool FolderMan::ensureJournalGone(const QString &localPath)
     return true;
 }
 
-void FolderMan::terminateCurrentSync()
-{
-    if( !_currentSyncFolder.isEmpty() ) {
-        qDebug() << "Terminating syncing on folder " << _currentSyncFolder;
-        terminateSyncProcess( _currentSyncFolder );
-    }
-}
-
 #define SLASH_TAG   QLatin1String("__SLASH__")
 #define BSLASH_TAG  QLatin1String("__BSLASH__")
 #define QMARK_TAG   QLatin1String("__QMARK__")
diff --git a/src/mirall/folderman.h b/src/mirall/folderman.h
index e51b93a..27723e0 100644
--- a/src/mirall/folderman.h
+++ b/src/mirall/folderman.h
@@ -107,6 +107,11 @@ public slots:
     void slotFolderSyncStarted();
     void slotFolderSyncFinished( const SyncResult& );
 
+    /**
+     * Terminates the specified folder sync (or the current one).
+     *
+     * It does not switch the folder to paused state.
+     */
     void terminateSyncProcess( const QString& alias = QString::null );
 
     /* unload and delete on folder object */
@@ -134,7 +139,6 @@ private slots:
 private:
     // finds all folder configuration files
     // and create the folders
-    void terminateCurrentSync();
     QString getBackupName( const QString& ) const;
     void registerFolderMonitor( Folder *folder );
 
diff --git a/src/mirall/selectivesyncdialog.cpp b/src/mirall/selectivesyncdialog.cpp
index c730743..081cfdb 100644
--- a/src/mirall/selectivesyncdialog.cpp
+++ b/src/mirall/selectivesyncdialog.cpp
@@ -291,7 +291,7 @@ void SelectiveSyncDialog::accept()
 
         FolderMan *folderMan = FolderMan::instance();
         if (_folder->isBusy()) {
-            _folder->slotTerminateSync();
+            _folder->slotTerminateAndPauseSync();
         }
         folderMan->slotScheduleSync(_folder->alias());
     }

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