From 55d4ee6586db8c5e254e11d0f5604168fbd686b3 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 17 Dec 2023 11:39:46 +0100 Subject: [PATCH] QFileDialog/win: pass only filename to IFileDialog::SetFileName() One more place were we should only pass the filename instead the full path to IFileDialog::SetFileName() Amends 19c701d370512e81d1b934f899b03ae0c2e6953f Task-number: QTBUG-47159 Change-Id: I3ac36eb2b6b6fe84fe6985590da882b1d5733efa Reviewed-by: Axel Spoerl (cherry picked from commit 2643210bd6e07aa1d8ae78c109592bdc2545b074) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 3252ef72d4bb14d1175495ed0be1381fd3b7ec2a) --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 1c7ad0c1022..986c6b33a32 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1551,7 +1551,7 @@ QWindowsNativeDialogBase *QWindowsFileDialogHelper::createNativeDialog() if (!info.isDir()) result->selectFile(info.fileName()); } else { - result->selectFile(url.path()); // TODO url.fileName() once it exists + result->selectFile(url.fileName()); } } // No need to select initialNameFilter if mode is Dir