Browse Source

DirectoryContentsList: Fix a bug in isStillLoading

pull/22/head
Tom Poole 3 years ago
parent
commit
68ad0ef3d8
2 changed files with 3 additions and 3 deletions
  1. +2
    -1
      modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp
  2. +1
    -2
      modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h

+ 2
- 1
modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.cpp View File

@@ -103,7 +103,7 @@ void DirectoryContentsList::refresh()
if (root.isDirectory())
{
fileFindHandle = std::make_unique<RangedDirectoryIterator>(root, false, "*", fileTypeFlags);
fileFindHandle = std::make_unique<RangedDirectoryIterator> (root, false, "*", fileTypeFlags);
shouldStop = false;
isSearching = true;
thread.addTimeSliceClient (this);
@@ -215,6 +215,7 @@ bool DirectoryContentsList::checkNextFile (bool& hasChanged)
}
fileFindHandle = nullptr;
isSearching = false;
if (! wasEmpty && files.isEmpty())
hasChanged = true;


+ 1
- 2
modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h View File

@@ -201,8 +201,7 @@ private:
OwnedArray<FileInfo> files;
std::unique_ptr<RangedDirectoryIterator> fileFindHandle;
std::atomic<bool> shouldStop { true };
bool isSearching = false;
std::atomic<bool> shouldStop { true }, isSearching { false };
bool wasEmpty = true;


Loading…
Cancel
Save