[Pkg-owncloud-commits] [owncloud-client] 145/332: Permissions: fix restoring subdirectories

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Aug 14 21:06:52 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 09881040a3d96f74b5160d4c2f976e9f12f162dc
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Fri Jun 27 13:34:15 2014 +0200

    Permissions:  fix restoring subdirectories
    
    The sync item vector must be sorted before we call checkForPermission
---
 src/mirall/owncloudpropagator.cpp | 9 ++++-----
 src/mirall/syncengine.cpp         | 3 +++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp
index d5ff55f..62376ba 100644
--- a/src/mirall/owncloudpropagator.cpp
+++ b/src/mirall/owncloudpropagator.cpp
@@ -216,14 +216,13 @@ PropagateItemJob* OwncloudPropagator::createJob(const SyncFileItem& item) {
     return 0;
 }
 
-void OwncloudPropagator::start(const SyncFileItemVector& _syncedItems)
+void OwncloudPropagator::start(const SyncFileItemVector& items)
 {
     /* This builds all the job needed for the propagation.
      * Each directories is a PropagateDirectory job, which contains the files in it.
-     * In order to do that we sort the items by destination. and loop over it. When we enter a
-     * directory, we can create the directory job and push it on the stack. */
-    SyncFileItemVector items = _syncedItems;
-    std::sort(items.begin(), items.end());
+     * In order to do that we loop over the items. (which are sorted by destination)
+     * When we enter adirectory, we can create the directory job and push it on the stack. */
+
     _rootJob.reset(new PropagateDirectory(this));
     QStack<QPair<QString /* directory name */, PropagateDirectory* /* job */> > directories;
     directories.push(qMakePair(QString(), _rootJob.data()));
diff --git a/src/mirall/syncengine.cpp b/src/mirall/syncengine.cpp
index 6352d4d..7d4dbb0 100644
--- a/src/mirall/syncengine.cpp
+++ b/src/mirall/syncengine.cpp
@@ -557,6 +557,9 @@ void SyncEngine::slotUpdateFinished(int updateResult)
         it->_file = adjustRenamedPath(it->_file);
     }
 
+    // Sort items per destination
+    std::sort(_syncedItems.begin(), _syncedItems.end());
+
     // make sure everything is allowed
     checkForPermission();
 

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