Skip to content

Commit

Permalink
Enable use of "Delete" button in FileProviderFileDelegate to evict item
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Oct 31, 2023
1 parent 9a581c1 commit 700261f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/gui/macOS/ui/FileProviderEvictionDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ApplicationWindow {
delegate: FileProviderFileDelegate {
width: parent.width
height: 60
onEvictItem: root.materialisedItemsModel.evictItem(identifier, domainIdentifier)
}
}
}
5 changes: 5 additions & 0 deletions src/gui/macOS/ui/FileProviderFileDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -78,6 +82,7 @@ Item {

text: qsTr("Delete")
bgColor: Style.errorBoxBackgroundColor
onClicked: root.evictItem(root.identifier, root.domainIdentifier)
}

EnforcedPlainTextLabel {
Expand Down

0 comments on commit 700261f

Please sign in to comment.