ShareDialog: Only link share if capabilities allow #4179

This commit is contained in:
Christian Kamm 2015-11-24 11:58:10 +01:00
parent adea301e5b
commit f96d94f143
2 changed files with 4 additions and 4 deletions

View file

@ -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();
}

View file

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