summaryrefslogtreecommitdiff
path: root/widgets/filedialog/FolderContents.qml
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/filedialog/FolderContents.qml')
-rw-r--r--widgets/filedialog/FolderContents.qml7
1 files changed, 4 insertions, 3 deletions
diff --git a/widgets/filedialog/FolderContents.qml b/widgets/filedialog/FolderContents.qml
index 81f8729..84449ca 100644
--- a/widgets/filedialog/FolderContents.qml
+++ b/widgets/filedialog/FolderContents.qml
@@ -16,6 +16,7 @@ Item {
id: root
required property var dialog
+ property alias currentItem: view.currentItem
StyledRect {
anchors.fill: parent
@@ -82,11 +83,11 @@ Item {
Keys.onEscapePressed: currentIndex = -1
Keys.onReturnPressed: {
- if (currentItem)
+ if (root.dialog.selectionValid)
root.dialog.accepted(currentItem.filePath);
}
Keys.onEnterPressed: {
- if (currentItem)
+ if (root.dialog.selectionValid)
root.dialog.accepted(currentItem.filePath);
}
@@ -127,7 +128,7 @@ Item {
onDoubleClicked: {
if (item.fileIsDir)
root.dialog.cwd.push(item.fileName);
- else
+ else if (root.dialog.selectionValid)
root.dialog.accepted(item.filePath);
}