ShareDialog: show an error if the sharing API is disabled (#4126)

This commit is contained in:
Olivier Goffart 2015-11-19 12:00:53 +01:00
parent d581550130
commit 575fc9acbd

View file

@ -76,6 +76,11 @@ ShareDialog::ShareDialog(AccountPtr account, const QString &sharePath, const QSt
this->setWindowTitle(tr("%1 Sharing").arg(Theme::instance()->appNameGUI())); this->setWindowTitle(tr("%1 Sharing").arg(Theme::instance()->appNameGUI()));
if (!account->capabilities().shareAPI()) {
_ui->shareWidgetsLayout->addWidget(new QLabel(tr("The server does not allow sharing")));
return;
}
bool autoShare = true; bool autoShare = true;
// We only do user/group sharing from 8.2.0 // We only do user/group sharing from 8.2.0
@ -120,7 +125,9 @@ void ShareDialog::getShares()
job->start(); job->start();
} }
_linkWidget->getShares(); if (_linkWidget) {
_linkWidget->getShares();
}
if (_userGroupWidget != NULL) { if (_userGroupWidget != NULL) {
_userGroupWidget->getShares(); _userGroupWidget->getShares();
} }