mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Fix calling FileListComponent::setSelectedFile after DirectoryContentsList::setDirectory
Prior to this fix calling setDirectory and then setSelectedFile from the same call stack could cause setSelectedFile to have no effect. This was because the directory change is asynchronously propagated from the DirectoryContentsList. This was picked up by the FileListComponent as a directory change after setSelectedFile, even though the directory change happened before.
This commit is contained in:
parent
b272f968aa
commit
b95ede49ff
1 changed files with 2 additions and 0 deletions
|
|
@ -72,6 +72,8 @@ void FileListComponent::scrollToTop()
|
|||
|
||||
void FileListComponent::setSelectedFile (const File& f)
|
||||
{
|
||||
lastDirectory = directoryContentsList.getDirectory();
|
||||
|
||||
if (! directoryContentsList.isStillLoading())
|
||||
{
|
||||
for (int i = directoryContentsList.getNumFiles(); --i >= 0;)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue