mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
DirectoryContentsList: Ensure change notification is sent after search completes
This fixes an issue where the FileListComponent might fail to select a file, because the file list reported that it was still loading during the final ChangeListener callback.
This commit is contained in:
parent
57d291588c
commit
00b1bf3f5b
1 changed files with 16 additions and 22 deletions
|
|
@ -202,33 +202,27 @@ int DirectoryContentsList::useTimeSlice()
|
|||
|
||||
bool DirectoryContentsList::checkNextFile (bool& hasChanged)
|
||||
{
|
||||
if (fileFindHandle != nullptr)
|
||||
if (fileFindHandle == nullptr)
|
||||
return false;
|
||||
|
||||
if (*fileFindHandle == RangedDirectoryIterator())
|
||||
{
|
||||
if (*fileFindHandle != RangedDirectoryIterator())
|
||||
{
|
||||
const auto entry = *(*fileFindHandle)++;
|
||||
|
||||
if (addFile (entry.getFile(),
|
||||
entry.isDirectory(),
|
||||
entry.getFileSize(),
|
||||
entry.getModificationTime(),
|
||||
entry.getCreationTime(),
|
||||
entry.isReadOnly()))
|
||||
{
|
||||
hasChanged = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
fileFindHandle = nullptr;
|
||||
isSearching = false;
|
||||
|
||||
if (! wasEmpty && files.isEmpty())
|
||||
hasChanged = true;
|
||||
hasChanged = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
const auto entry = *(*fileFindHandle)++;
|
||||
|
||||
hasChanged |= addFile (entry.getFile(),
|
||||
entry.isDirectory(),
|
||||
entry.getFileSize(),
|
||||
entry.getModificationTime(),
|
||||
entry.getCreationTime(),
|
||||
entry.isReadOnly());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DirectoryContentsList::addFile (const File& file, const bool isDir,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue