From 700261f12c6205862261e50658e3c4c4bf1a1211 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 31 Oct 2023 17:28:58 +0800 Subject: [PATCH] Enable use of "Delete" button in FileProviderFileDelegate to evict item Signed-off-by: Claudio Cambra --- src/gui/macOS/ui/FileProviderEvictionDialog.qml | 1 + src/gui/macOS/ui/FileProviderFileDelegate.qml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/gui/macOS/ui/FileProviderEvictionDialog.qml b/src/gui/macOS/ui/FileProviderEvictionDialog.qml index 15e4a2da82f4..5884b63770a9 100644 --- a/src/gui/macOS/ui/FileProviderEvictionDialog.qml +++ b/src/gui/macOS/ui/FileProviderEvictionDialog.qml @@ -39,6 +39,7 @@ ApplicationWindow { delegate: FileProviderFileDelegate { width: parent.width height: 60 + onEvictItem: root.materialisedItemsModel.evictItem(identifier, domainIdentifier) } } } diff --git a/src/gui/macOS/ui/FileProviderFileDelegate.qml b/src/gui/macOS/ui/FileProviderFileDelegate.qml index 48b6acf4987b..533bb70469fe 100644 --- a/src/gui/macOS/ui/FileProviderFileDelegate.qml +++ b/src/gui/macOS/ui/FileProviderFileDelegate.qml @@ -25,7 +25,11 @@ import com.nextcloud.desktopclient 1.0 Item { id: root + signal evictItem(string identifier, string domainIdentifier) + // Match with model rolenames for automagic setting of properties + required property string identifier + required property string domainIdentifier required property string fileName required property string userVisiblePath required property string fileType @@ -78,6 +82,7 @@ Item { text: qsTr("Delete") bgColor: Style.errorBoxBackgroundColor + onClicked: root.evictItem(root.identifier, root.domainIdentifier) } EnforcedPlainTextLabel {