1
0
Fork 0
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:
jules 2018-01-17 11:23:12 +00:00
parent 7912349b55
commit 415f0e4c90
15 changed files with 75 additions and 116 deletions

View file

@ -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());