From f29210d4a2c0c3bd354be68ce7966e93af0690a6 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 20 Dec 2022 15:48:15 -0500 Subject: [PATCH] fix(image): fix image download on Windows Fixes #8755 --- src/app/global/utils.nim | 3 ++- ui/imports/shared/views/chat/MessageContextMenuView.qml | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/global/utils.nim b/src/app/global/utils.nim index a1655909db..5c4bd53417 100644 --- a/src/app/global/utils.nim +++ b/src/app/global/utils.nim @@ -115,7 +115,8 @@ QtObject: downloadImage(content, path) proc downloadImageByUrl*(self: Utils, url: string, path: string) {.slot.} = - downloadImageByUrl(url, path) + let pathFormatted = self.formatImagePath(path) + downloadImageByUrl(url, pathFormatted) proc generateQRCodeSVG*(self: Utils, text: string, border: int = 0): string = var qr0: array[0..qrcodegen_BUFFER_LEN_MAX, uint8] diff --git a/ui/imports/shared/views/chat/MessageContextMenuView.qml b/ui/imports/shared/views/chat/MessageContextMenuView.qml index 38a155d313..259bdfbd5e 100644 --- a/ui/imports/shared/views/chat/MessageContextMenuView.qml +++ b/ui/imports/shared/views/chat/MessageContextMenuView.qml @@ -470,10 +470,12 @@ StatusMenu { id: fileDialog title: qsTr("Please choose a directory") selectFolder: true + selectExisting : true + selectMultiple: false modality: Qt.NonModal onAccepted: { if (root.imageSource) { - root.store.downloadImageByUrl(root.imageSource, fileDialog.fileUrls) + root.store.downloadImageByUrl(root.imageSource, fileDialog.fileUrl) } fileDialog.close() }