More distinctly name server allowing resharing property

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-08-11 07:33:49 +08:00
parent 372cd9b9a4
commit d428915d35
5 changed files with 12 additions and 12 deletions

View file

@ -52,7 +52,7 @@ GridLayout {
property bool backgroundsVisible: true property bool backgroundsVisible: true
property bool canCreateLinkShares: true property bool canCreateLinkShares: true
property bool canReshare: true property bool serverAllowsResharing: true
readonly property bool isLinkShare: model.shareType === ShareModel.ShareTypeLink readonly property bool isLinkShare: model.shareType === ShareModel.ShareTypeLink
readonly property bool isPlaceholderLinkShare: model.shareType === ShareModel.ShareTypePlaceholderLink readonly property bool isPlaceholderLinkShare: model.shareType === ShareModel.ShareTypePlaceholderLink
@ -269,7 +269,7 @@ GridLayout {
shareModelData: model shareModelData: model
canCreateLinkShares: root.canCreateLinkShares canCreateLinkShares: root.canCreateLinkShares
canReshare: root.canReshare serverAllowsResharing: root.serverAllowsResharing
onCloseShareDetails: root.rootStackView.pop(root.rootStackView.initialItem, StackView.PopTransition) onCloseShareDetails: root.rootStackView.pop(root.rootStackView.initialItem, StackView.PopTransition)

View file

@ -49,7 +49,7 @@ Page {
property var shareModelData: ({}) property var shareModelData: ({})
property bool canCreateLinkShares: true property bool canCreateLinkShares: true
property bool canReshare: true property bool serverAllowsResharing: true
readonly property var share: shareModelData.share ?? ({}) readonly property var share: shareModelData.share ?? ({})
@ -448,8 +448,8 @@ Page {
checkable: true checkable: true
checked: root.resharingAllowed checked: root.resharingAllowed
text: qsTr("Allow resharing") text: qsTr("Allow resharing")
enabled: !root.isSharePermissionChangeInProgress && root.canReshare enabled: !root.isSharePermissionChangeInProgress && root.serverAllowsResharing
visible: root.canReshare visible: root.serverAllowsResharing
onClicked: root.toggleAllowResharing(checked); onClicked: root.toggleAllowResharing(checked);
Connections { Connections {

View file

@ -35,7 +35,7 @@ ColumnLayout {
readonly property bool sharingPossible: shareModel && shareModel.canShare && shareModel.sharingEnabled readonly property bool sharingPossible: shareModel && shareModel.canShare && shareModel.sharingEnabled
readonly property bool userGroupSharingPossible: sharingPossible && shareModel.userGroupSharingEnabled readonly property bool userGroupSharingPossible: sharingPossible && shareModel.userGroupSharingEnabled
readonly property bool publicLinkSharingPossible: sharingPossible && shareModel.publicLinkSharesEnabled readonly property bool publicLinkSharingPossible: sharingPossible && shareModel.publicLinkSharesEnabled
readonly property bool resharingAllowed: shareModel && shareModel.resharingAllowed readonly property bool serverAllowsResharing: shareModel && shareModel.serverAllowsResharing
readonly property bool loading: sharingPossible && (!shareModel || readonly property bool loading: sharingPossible && (!shareModel ||
shareModel.fetchOngoing || shareModel.fetchOngoing ||
@ -215,7 +215,7 @@ ColumnLayout {
rootStackView: root.rootStackView rootStackView: root.rootStackView
backgroundsVisible: root.backgroundsVisible backgroundsVisible: root.backgroundsVisible
canCreateLinkShares: root.publicLinkSharingPossible canCreateLinkShares: root.publicLinkSharingPossible
canReshare: root.resharingAllowed serverAllowsResharing: root.serverAllowsResharing
onCreateNewLinkShare: { onCreateNewLinkShare: {
root.waitingForSharesToChange = true; root.waitingForSharesToChange = true;

View file

@ -1251,7 +1251,7 @@ void ShareModel::setAccountState(AccountState *accountState)
Q_EMIT sharingEnabledChanged(); Q_EMIT sharingEnabledChanged();
Q_EMIT publicLinkSharesEnabledChanged(); Q_EMIT publicLinkSharesEnabledChanged();
Q_EMIT userGroupSharingEnabledChanged(); Q_EMIT userGroupSharingEnabledChanged();
Q_EMIT resharingAllowedChanged(); Q_EMIT serverAllowsResharingChanged();
updateData(); updateData();
} }
@ -1311,7 +1311,7 @@ bool ShareModel::canShare() const
return _maxSharingPermissions & SharePermissionShare; return _maxSharingPermissions & SharePermissionShare;
} }
bool ShareModel::resharingAllowed() const bool ShareModel::serverAllowsResharing() const
{ {
return _accountState && _accountState->account() && _accountState->account()->capabilities().isValid() return _accountState && _accountState->account() && _accountState->account()->capabilities().isValid()
&& _accountState->account()->capabilities().shareResharing(); && _accountState->account()->capabilities().shareResharing();

View file

@ -35,7 +35,7 @@ class ShareModel : public QAbstractListModel
Q_PROPERTY(bool canShare READ canShare NOTIFY sharePermissionsChanged) Q_PROPERTY(bool canShare READ canShare NOTIFY sharePermissionsChanged)
Q_PROPERTY(bool fetchOngoing READ fetchOngoing NOTIFY fetchOngoingChanged) Q_PROPERTY(bool fetchOngoing READ fetchOngoing NOTIFY fetchOngoingChanged)
Q_PROPERTY(bool hasInitialShareFetchCompleted READ hasInitialShareFetchCompleted NOTIFY hasInitialShareFetchCompletedChanged) Q_PROPERTY(bool hasInitialShareFetchCompleted READ hasInitialShareFetchCompleted NOTIFY hasInitialShareFetchCompletedChanged)
Q_PROPERTY(bool resharingAllowed READ resharingAllowed NOTIFY resharingAllowedChanged) Q_PROPERTY(bool serverAllowsResharing READ serverAllowsResharing NOTIFY serverAllowsResharingChanged)
Q_PROPERTY(QVariantList sharees READ sharees NOTIFY shareesChanged) Q_PROPERTY(QVariantList sharees READ sharees NOTIFY shareesChanged)
public: public:
@ -117,7 +117,7 @@ public:
[[nodiscard]] bool publicLinkSharesEnabled() const; [[nodiscard]] bool publicLinkSharesEnabled() const;
[[nodiscard]] bool userGroupSharingEnabled() const; [[nodiscard]] bool userGroupSharingEnabled() const;
[[nodiscard]] bool canShare() const; [[nodiscard]] bool canShare() const;
[[nodiscard]] bool resharingAllowed() const; [[nodiscard]] bool serverAllowsResharing() const;
[[nodiscard]] bool fetchOngoing() const; [[nodiscard]] bool fetchOngoing() const;
[[nodiscard]] bool hasInitialShareFetchCompleted() const; [[nodiscard]] bool hasInitialShareFetchCompleted() const;
@ -137,7 +137,7 @@ signals:
void hasInitialShareFetchCompletedChanged(); void hasInitialShareFetchCompletedChanged();
void shareesChanged(); void shareesChanged();
void internalLinkReady(); void internalLinkReady();
void resharingAllowedChanged(); void serverAllowsResharingChanged();
void serverError(const int code, const QString &message); void serverError(const int code, const QString &message);
void passwordSetError(const QString &shareId, const int code, const QString &message); void passwordSetError(const QString &shareId, const int code, const QString &message);