mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Merge pull request #4090 from nextcloud/feature/hide-share-for-deleted
Hide share button for deleted files and ignored files in tray activity
This commit is contained in:
commit
2ba0df3d3c
@ -152,7 +152,7 @@ MouseArea {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
flat: true
|
||||
hoverEnabled: true
|
||||
visible: displayActions && (path !== "")
|
||||
visible: isShareable
|
||||
display: AbstractButton.IconOnly
|
||||
icon.source: "qrc:///client/theme/share.svg"
|
||||
icon.color: "transparent"
|
||||
|
||||
@ -68,6 +68,7 @@ QHash<int, QByteArray> ActivityListModel::roleNames() const
|
||||
roles[ObjectTypeRole] = "objectType";
|
||||
roles[PointInTimeRole] = "dateTime";
|
||||
roles[DisplayActions] = "displayActions";
|
||||
roles[ShareableRole] = "isShareable";
|
||||
return roles;
|
||||
}
|
||||
|
||||
@ -262,6 +263,8 @@ QVariant ActivityListModel::data(const QModelIndex &index, int role) const
|
||||
return (ast && ast->isConnected());
|
||||
case DisplayActions:
|
||||
return _displayActions;
|
||||
case ShareableRole:
|
||||
return !data(index, PathRole).toString().isEmpty() && _displayActions && a._fileAction != "file_deleted" && a._status != SyncFileItem::FileIgnored;
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
@ -60,6 +60,7 @@ public:
|
||||
AccountConnectedRole,
|
||||
SyncFileStatusRole,
|
||||
DisplayActions,
|
||||
ShareableRole,
|
||||
};
|
||||
Q_ENUM(DataRole)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user