TFilenameEdit: don't force the TOpenDialog.InitialDir to current directory if InitialDir is empty string. Issue #40845.

This commit is contained in:
Bart 2024-03-14 19:46:07 +01:00
parent 0ad56931a0
commit 7446930ef3

View File

@ -1451,7 +1451,10 @@ begin
O.Options := DialogOptions; O.Options := DialogOptions;
O.Filter := Filter; O.Filter := Filter;
O.FilterIndex := FilterIndex; O.FilterIndex := FilterIndex;
O.InitialDir := CleanAndExpandDirectory(InitialDir); if (InitialDir <> '') then //don't force currentdir here, let WS do it's normal "magic" to decide where to open
O.InitialDir := CleanAndExpandDirectory(InitialDir)
else
O.InitialDir := '';
end; end;
// Set some common things. // Set some common things.
Result.Title := DialogTitle; Result.Title := DialogTitle;