Fix variable lookup in the timeline delegates

This fix issues with downloading and interacting with files
This commit is contained in:
Carl Schwan
2021-12-26 21:48:37 +01:00
parent 8a70e240e4
commit aa9dcc87cb
3 changed files with 63 additions and 65 deletions

View File

@@ -21,9 +21,20 @@ TimelineContainer {
onReplyClicked: ListView.view.goToEvent(eventID)
hoverComponent: hoverActions
readonly property bool downloaded: progressInfo && progressInfo.completed
function saveFileAs() {
const dialog = fileDialog.createObject(QQC2.ApplicationWindow.overlay)
dialog.open()
dialog.currentFile = dialog.folder + "/" + currentRoom.fileNameToDownload(eventId)
}
function openSavedFile() {
if (Qt.openUrlExternally(progressInfo.localPath)) return;
if (Qt.openUrlExternally(progressInfo.localDir)) return;
}
innerObject: RowLayout {
property bool openOnFinished: false
readonly property bool downloaded: progressInfo && progressInfo.completed
Layout.fillWidth: true
Layout.maximumWidth: fileDelegate.bubbleMaxWidth
@@ -129,16 +140,5 @@ TimelineContainer {
acceptedButtons: Qt.LeftButton
onLongPressed: openFileContext(model, parent)
}
function saveFileAs() {
var dialog = fileDialog.createObject(QQC2.ApplicationWindow.overlay)
dialog.open()
dialog.currentFile = dialog.folder + "/" + currentRoom.fileNameToDownload(eventId)
}
function openSavedFile() {
if (Qt.openUrlExternally(progressInfo.localPath)) return;
if (Qt.openUrlExternally(progressInfo.localDir)) return;
}
}
}