Share UI: Hide 'can share' if capability missing #4231

This commit is contained in:
Christian Kamm 2015-12-08 12:58:56 +01:00
parent 1a519ac1fb
commit cec4b803cf
3 changed files with 14 additions and 0 deletions

View file

@ -35,6 +35,11 @@ Share::Share(AccountPtr account,
}
AccountPtr Share::account() const
{
return _account;
}
QString Share::getId() const
{
return _id;

View file

@ -66,6 +66,11 @@ public:
const Permissions permissions = PermissionDefault,
const QSharedPointer<Sharee> shareWith = QSharedPointer<Sharee>(NULL));
/**
* The account the share is defined on.
*/
AccountPtr account() const;
/*
* Get the id
*/

View file

@ -246,6 +246,10 @@ ShareWidget::ShareWidget(QSharedPointer<Share> share,
_ui->deleteShareButton->setIcon(QIcon::fromTheme(QLatin1String("user-trash"),
QIcon(QLatin1String(":/client/resources/delete.png"))));
if (!share->account()->capabilities().shareResharing()) {
_ui->permissionShare->hide();
}
}
void ShareWidget::on_deleteShareButton_clicked()