mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Create common validCapabilities used by several ShareModel methods checking account capabilities
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
269f8c4202
commit
bf8cb8305e
@ -1014,20 +1014,23 @@ bool ShareModel::accountConnected() const
|
||||
return _accountState && _accountState->isConnected();
|
||||
}
|
||||
|
||||
bool ShareModel::sharingEnabled() const
|
||||
bool ShareModel::validCapabilities() const
|
||||
{
|
||||
return _accountState &&
|
||||
_accountState->account() &&
|
||||
_accountState->account()->capabilities().isValid() &&
|
||||
_accountState->account()->capabilities().isValid();
|
||||
}
|
||||
|
||||
bool ShareModel::sharingEnabled() const
|
||||
{
|
||||
return validCapabilities() &&
|
||||
_accountState->account()->capabilities().shareAPI();
|
||||
}
|
||||
|
||||
bool ShareModel::publicLinkSharesEnabled() const
|
||||
{
|
||||
return Theme::instance()->linkSharing() &&
|
||||
_accountState &&
|
||||
_accountState->account() &&
|
||||
_accountState->account()->capabilities().isValid() &&
|
||||
validCapabilities() &&
|
||||
_accountState->account()->capabilities().sharePublicLink();
|
||||
}
|
||||
|
||||
|
||||
@ -182,6 +182,7 @@ private:
|
||||
[[nodiscard]] QString avatarUrlForShare(const SharePtr &share) const;
|
||||
[[nodiscard]] long long enforcedMaxExpireDateForShare(const SharePtr &share) const;
|
||||
[[nodiscard]] bool expireDateEnforcedForShare(const SharePtr &share) const;
|
||||
[[nodiscard]] bool validCapabilities() const;
|
||||
|
||||
bool _fetchOngoing = false;
|
||||
bool _hasInitialShareFetchCompleted = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user