1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Reworked the logic in FileBrowserComponent::currentFileIsValid() to ensure that directories can't be selected when only browsing for files

This commit is contained in:
ed 2019-04-29 11:24:22 +01:00
parent 8eb626a338
commit 3c312b9d76

View file

@ -180,10 +180,10 @@ bool FileBrowserComponent::currentFileIsValid() const
{
auto f = getSelectedFile (0);
if (isSaveMode())
return (flags & canSelectDirectories) != 0 || ! f.isDirectory();
if ((flags & canSelectDirectories) == 0 && f.isDirectory())
return false;
return f.exists();
return isSaveMode() || f.exists();
}
File FileBrowserComponent::getHighlightedFile() const noexcept