mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Added an alternative version of File::findChildFiles that returns the results array rather than it being an out-parameter. In almost all cases using this new version will make your code smaller and cleaner, as you can see from all the changes in this commit!
This commit is contained in:
parent
7912349b55
commit
415f0e4c90
15 changed files with 75 additions and 116 deletions
|
|
@ -577,14 +577,8 @@ void FileBrowserComponent::getDefaultRoots (StringArray& rootNames, StringArray&
|
|||
rootPaths.add ({});
|
||||
rootNames.add ({});
|
||||
|
||||
Array<File> volumes;
|
||||
File vol ("/Volumes");
|
||||
vol.findChildFiles (volumes, File::findDirectories, false);
|
||||
|
||||
for (int i = 0; i < volumes.size(); ++i)
|
||||
for (auto& volume : File ("/Volumes").findChildFiles (File::findDirectories, false))
|
||||
{
|
||||
const File& volume = volumes.getReference(i);
|
||||
|
||||
if (volume.isDirectory() && ! volume.getFileName().startsWithChar ('.'))
|
||||
{
|
||||
rootPaths.add (volume.getFullPathName());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue