[Pkg-owncloud-commits] [owncloud-client] 402/484: ShareDialog: Only link share if capabilities allow #4179

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:38:12 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 f96d94f1437e7d8ec504be96735309fdadece225
Author: Christian Kamm <mail at ckamm.de>
Date:   Tue Nov 24 11:58:10 2015 +0100

    ShareDialog: Only link share if capabilities allow #4179
---
 src/gui/sharelinkwidget.cpp  | 6 +++---
 src/libsync/capabilities.cpp | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gui/sharelinkwidget.cpp b/src/gui/sharelinkwidget.cpp
index b1d971f..97a6b5e 100644
--- a/src/gui/sharelinkwidget.cpp
+++ b/src/gui/sharelinkwidget.cpp
@@ -221,8 +221,8 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
     const QString versionString = _account->serverVersion();
     qDebug() << Q_FUNC_INFO << versionString << "Fetched" << shares.count() << "shares";
 
-    //Show link checkbox now
-    _ui->checkBox_shareLink->setEnabled(true);
+    //Show link checkbox now if capabilities allow it
+    _ui->checkBox_shareLink->setEnabled(_account->capabilities().sharePublicLink());
     _pi_link->stopAnimation();
 
     Q_FOREACH(auto share, shares) {
@@ -292,7 +292,7 @@ void ShareLinkWidget::slotSharesFetched(const QList<QSharedPointer<Share>> &shar
         if( !_resharingAllowed ) {
             displayError(tr("The file can not be shared because it was shared without sharing permission."));
             _ui->checkBox_shareLink->setEnabled(false);
-        } else if (_autoShare) {
+        } else if (_autoShare && _ui->checkBox_shareLink->isEnabled()) {
             _ui->checkBox_shareLink->setChecked(true);
             slotCheckBoxShareLinkClicked();
         }
diff --git a/src/libsync/capabilities.cpp b/src/libsync/capabilities.cpp
index 202be49..f6e4edd 100644
--- a/src/libsync/capabilities.cpp
+++ b/src/libsync/capabilities.cpp
@@ -37,7 +37,7 @@ bool Capabilities::shareAPI() const
 
 bool Capabilities::sharePublicLink() const
 {
-    return _capabilities["files_sharing"].toMap()["public"].toMap()["enabled"].toBool();
+    return shareAPI() && _capabilities["files_sharing"].toMap()["public"].toMap()["enabled"].toBool();
 }
 
 bool Capabilities::sharePublicLinkAllowUpload() const

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