mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Hide share button for deleted and ignored files in tray activity
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
This commit is contained in:
parent
fc366933e4
commit
8c091a2daa
3 changed files with 5 additions and 1 deletions
|
@ -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 a new issue