Browse Source

FileChooser: Always set initial directory if the initialFileOrDirectory argument is not empty

v6.1.6
reuk 4 years ago
parent
commit
1d29091133
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 14 additions and 2 deletions
  1. +14
    -2
      modules/juce_gui_basics/native/juce_win32_FileChooser.cpp

+ 14
- 2
modules/juce_gui_basics/native/juce_win32_FileChooser.cpp View File

@@ -215,8 +215,13 @@ private:
return ptr;
}();
if (item == nullptr || FAILED (dialog.SetDefaultFolder (item)))
return false;
if (item != nullptr)
{
dialog.SetDefaultFolder (item);
if (! initialPath.isEmpty())
dialog.SetFolder (item);
}
String filename (files.getData());
@@ -431,6 +436,13 @@ private:
#else
of.lStructSize = sizeof (of);
#endif
if (files[0] != 0)
{
auto startingFile = File (initialPath).getChildFile (String (files.get()));
startingFile.getFullPathName().copyToUTF16 (files, charsAvailableForResult * sizeof (WCHAR));
}
of.hwndOwner = (HWND) (async ? nullptr : owner->getWindowHandle());
of.lpstrFilter = filters.getData();
of.nFilterIndex = 1;


Loading…
Cancel
Save