Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/qml/components/StorageLocations.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,28 @@ ColumnLayout {
description: qsTr("Choose the directory and storage device.")
customDir: customDirOption.checked ? fileDialog.folder : ""
checked: optionsModel.dataDir !== optionsModel.getDefaultDataDirString
onClicked: fileDialog.open()
onClicked: {
if (AppMode.isDesktop) {
if (!singleClickTimer.running) {
// Start the timer if it's not already running
singleClickTimer.start();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concept NACK on using a timer here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree wasn't the best approach, let's see if this is still an issue after #427 and #428. I'll close this PR till then.

} else {
// If the timer is running, it's a double-click
singleClickTimer.stop();
}
} else {
fileDialog.open()
}
}
Timer {
id: singleClickTimer
interval: 300
onTriggered: {
// If the timer times out, it's a single-click
fileDialog.open()
}
repeat: false // No need to repeat the timer
}
}
FileDialog {
id: fileDialog
Expand Down
Loading