[Pkg-owncloud-commits] [owncloud-client] 121/498: Fix folder concatenation with Qt4

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:48:42 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 12f760535dd766eb0d16e6237775438d17fc2b8c
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Tue Jun 2 20:41:59 2015 +0200

    Fix folder concatenation with Qt4
    
    QUrl in Qt4 do not simplify double slashes like Qt5 does, so we have
    to take in account different slashes possibilities
---
 src/gui/folder.cpp            | 9 +--------
 src/gui/folderstatusmodel.cpp | 9 ++++++++-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp
index 73cade4..e4b8151 100644
--- a/src/gui/folder.cpp
+++ b/src/gui/folder.cpp
@@ -204,14 +204,7 @@ QString Folder::remotePath() const
 
 QUrl Folder::remoteUrl() const
 {
-    QUrl url = _accountState->account()->davUrl();
-    QString path = url.path();
-    if (!path.endsWith('/')) {
-        path.append('/');
-    }
-    path.append(remotePath());
-    url.setPath(path);
-    return url;
+    return Account::concatUrlPath(_accountState->account()->davUrl(), remotePath());
 }
 
 QString Folder::nativePath() const
diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp
index 69aecf5..55535f7 100644
--- a/src/gui/folderstatusmodel.cpp
+++ b/src/gui/folderstatusmodel.cpp
@@ -357,7 +357,14 @@ void FolderStatusModel::fetchMore(const QModelIndex& parent)
         return;
 
     info->_fetching = true;
-    LsColJob *job = new LsColJob(_account, info->_folder->remotePath() + "/" + info->_path, this);
+    QString path = info->_folder->remotePath();
+    if (info->_path != QLatin1String("/")) {
+        if (!path.endsWith(QLatin1Char('/'))) {
+            path += QLatin1Char('/');
+        }
+        path += info->_path;
+    }
+    LsColJob *job = new LsColJob(_account, path, this);
     job->setProperties(QList<QByteArray>() << "resourcetype" << "quota-used-bytes");
     job->setTimeout(5 * 1000);
     connect(job, SIGNAL(directoryListingSubfolders(QStringList)),

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