[Pkg-owncloud-commits] [owncloud-client] 156/332: SocketAPI: Try to make the folder selection work on windows

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Aug 14 21:06:53 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 ad2eabeb3b1d3d9e4f9dd40ad6c30225c2169578
Author: Daniel Molkentin <danimo at owncloud.com>
Date:   Tue Jul 1 16:24:14 2014 +0200

    SocketAPI: Try to make the folder selection work on windows
---
 src/mirall/folderman.cpp | 7 +++----
 src/mirall/folderman.h   | 2 +-
 src/mirall/socketapi.cpp | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/mirall/folderman.cpp b/src/mirall/folderman.cpp
index 6c4b1b8..5b55e4c 100644
--- a/src/mirall/folderman.cpp
+++ b/src/mirall/folderman.cpp
@@ -496,14 +496,13 @@ void FolderMan::addFolderDefinition(const QString& alias, const QString& sourceF
     settings.sync();
 }
 
-Folder *FolderMan::folderForPath(const QUrl &path)
+Folder *FolderMan::folderForPath(const QString &path)
 {
-    QString absolutePath = path.toLocalFile();
-    absolutePath.append("/");
+    QString absolutePath = QDir::cleanPath(path+QLatin1Char('/'));
 
     foreach(Folder* folder, map().values())
     {
-        if(absolutePath.startsWith(folder->path()))
+        if(absolutePath.startsWith(QDir::cleanPath(folder->path())))
         {
             qDebug() << "found folder: " << folder->path() << " for " << absolutePath;
             return folder;
diff --git a/src/mirall/folderman.h b/src/mirall/folderman.h
index 0f4a79d..3c51a0e 100644
--- a/src/mirall/folderman.h
+++ b/src/mirall/folderman.h
@@ -52,7 +52,7 @@ public:
     void addFolderDefinition(const QString&, const QString&, const QString& );
 
     /** Returns the folder which the file or directory stored in path is in */
-    Folder* folderForPath(const QUrl& path);
+    Folder* folderForPath(const QString& path);
 
     /** Returns the folder by alias or NULL if no folder with the alias exists. */
     Folder *folder( const QString& );
diff --git a/src/mirall/socketapi.cpp b/src/mirall/socketapi.cpp
index bc193ae..4b960fd 100644
--- a/src/mirall/socketapi.cpp
+++ b/src/mirall/socketapi.cpp
@@ -294,7 +294,7 @@ void SocketApi::command_RETRIEVE_FILE_STATUS(const QString& argument, QLocalSock
 
     QString statusString;
 
-    Folder* folder = FolderMan::instance()->folderForPath( QUrl::fromLocalFile(argument) );
+    Folder* folder = FolderMan::instance()->folderForPath( argument );
     // this can happen in offline mode e.g.: nothing to worry about
     if (!folder) {
         DEBUG << "folder offline or not watched:" << argument;

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