[Pkg-owncloud-commits] [owncloud-client] 98/332: permission: read them from the tree

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Aug 14 21:06:44 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 c759e8bb8f35630cae401db9d950caf70e4ab7d6
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Tue Jun 17 14:50:24 2014 +0200

    permission: read them from the tree
---
 src/mirall/syncengine.cpp | 11 +++++++----
 src/mirall/syncengine.h   |  5 ++++-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/mirall/syncengine.cpp b/src/mirall/syncengine.cpp
index 3d391aa..bb8f5ca 100644
--- a/src/mirall/syncengine.cpp
+++ b/src/mirall/syncengine.cpp
@@ -395,6 +395,11 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote )
     item.log._other_size        = file->other.size;
 
     _syncedItems.append(item);
+
+    if (remote && file->remotePerm) {
+        _remotePerms[item._file] = file->remotePerm;
+    }
+
     emit syncItemDiscovered(item);
     return re;
 }
@@ -867,19 +872,17 @@ void SyncEngine::checkForPermission()
     }
 }
 
-QByteArray SyncEngine::getPermissions(const QString& file)
+QByteArray SyncEngine::getPermissions(const QString& file) const
 {
     //FIXME;
     static bool isTest = qgetenv("OWNCLOUD_TEST_PERMISSIONS").toInt();
     if (isTest) {
         QRegExp rx("_PERM_([^_]*)_[^/]*$");
         if (rx.indexIn(file) != -1) {
-            qDebug() << Q_FUNC_INFO << file << rx.cap(1);
             return rx.cap(1).toLatin1();
         }
     }
-    qDebug() << Q_FUNC_INFO << file << "*" << isTest;
-    return QByteArray();
+    return _remotePerms.value(file);
 }
 
 
diff --git a/src/mirall/syncengine.h b/src/mirall/syncengine.h
index cb45f32..7447ff3 100644
--- a/src/mirall/syncengine.h
+++ b/src/mirall/syncengine.h
@@ -131,12 +131,15 @@ private:
      * to recover
      */
     void checkForPermission();
-    QByteArray getPermissions(const QString& file);
+    QByteArray getPermissions(const QString& file) const;
 
     bool _hasFiles; // true if there is at least one file that is not ignored or removed
 
     int _uploadLimit;
     int _downloadLimit;
+
+    // hash containing the permissions on the remote directory
+    QHash<QString, QByteArray> _remotePerms;
 };
 
 

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