[Pkg-owncloud-commits] [owncloud-client] 378/498: If the OCS Share API returns an url use that

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:08 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 a2f9ba47fb40972fad962ef0022511d24be6ed48
Author: Roeland Jago Douma <roeland at famdouma.nl>
Date:   Fri Jul 17 09:23:55 2015 +0200

    If the OCS Share API returns an url use that
    
    To avoid us having to construct the URL for public shares just rely on the
    server to do it.
    
    This makes it easier to maintain. For example if (in the not do distat future)
    the index.php part is removed the server would just server this new url.
---
 src/gui/sharedialog.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp
index 19274c5..f3e123f 100644
--- a/src/gui/sharedialog.cpp
+++ b/src/gui/sharedialog.cpp
@@ -329,8 +329,11 @@ void ShareDialog::slotSharesFetched(const QVariantMap &reply)
             }
 
             QString url;
-            // From ownCloud server version 8 on, a different share link scheme is used.
-            if (versionString.contains('.') && versionString.split('.')[0].toInt() >= 8) {
+            // From ownCloud server 8.2 the url field is always set for public shares
+            if (data.contains("url")) {
+                url = data.value("url").toString();
+            } else if (versionString.contains('.') && versionString.split('.')[0].toInt() >= 8) {
+                // From ownCloud server version 8 on, a different share link scheme is used.
                 url = Account::concatUrlPath(_account->url(), QString("index.php/s/%1").arg(data.value("token").toString())).toString();
             } else {
                 QList<QPair<QString, QString>> queryArgs;

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