[Pkg-owncloud-commits] [owncloud-client] 323/484: Folderman: Added method to find local files for a rel. server path.

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:59 UTC 2015


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 caba719950afb7fee5662cd17a2074bd35b8cc24
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon Nov 16 15:04:59 2015 +0100

    Folderman: Added method to find local files for a rel. server path.
---
 src/gui/folderman.cpp | 17 +++++++++++++++++
 src/gui/folderman.h   |  7 +++++++
 2 files changed, 24 insertions(+)

diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp
index 9f4ec17..5930cf0 100644
--- a/src/gui/folderman.cpp
+++ b/src/gui/folderman.cpp
@@ -830,6 +830,23 @@ Folder *FolderMan::folderForPath(const QString &path)
     return 0;
 }
 
+QStringList FolderMan::findFileInLocalFolders( const QString& relPath )
+{
+    QStringList re;
+
+    foreach(Folder* folder, this->map().values()) {
+        QString path = folder->cleanPath();
+        QString remRelPath;
+        remRelPath = relPath.mid(folder->remotePath().length());
+        path += remRelPath;
+
+        if( QFile::exists(path) ) {
+            re.append( path );
+        }
+    }
+    return re;
+}
+
 void FolderMan::slotRemoveFolder( Folder *f )
 {
     if( !f ) {
diff --git a/src/gui/folderman.h b/src/gui/folderman.h
index 0dd0522..888cd39 100644
--- a/src/gui/folderman.h
+++ b/src/gui/folderman.h
@@ -57,6 +57,13 @@ public:
     /** Returns the folder which the file or directory stored in path is in */
     Folder* folderForPath(const QString& path);
 
+    /**
+      * returns a list of local files that exist on the local harddisk for an
+      * incoming relative server path. The method checks with all existing sync
+      * folders.
+      */
+    QStringList findFileInLocalFolders( const QString& relPath );
+
     /** Returns the folder by alias or NULL if no folder with the alias exists. */
     Folder *folder( const QString& );
 

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