Browse Source

Added method FileBrowserComponent::getDefaultRoots()

tags/2021-05-28
jules 12 years ago
parent
commit
227e7d70f9
2 changed files with 15 additions and 2 deletions
  1. +6
    -1
      modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp
  2. +9
    -1
      modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h

+ 6
- 1
modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp View File

@@ -497,7 +497,7 @@ void FileBrowserComponent::comboBoxChanged (ComboBox*)
}
}
void FileBrowserComponent::getRoots (StringArray& rootNames, StringArray& rootPaths)
void FileBrowserComponent::getDefaultRoots (StringArray& rootNames, StringArray& rootPaths)
{
#if JUCE_WINDOWS
Array<File> roots;
@@ -571,3 +571,8 @@ void FileBrowserComponent::getRoots (StringArray& rootNames, StringArray& rootPa
rootNames.add ("Desktop");
#endif
}
void FileBrowserComponent::getRoots (StringArray& rootNames, StringArray& rootPaths)
{
getDefaultRoots (rootNames, rootPaths);
}

+ 9
- 1
modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h View File

@@ -176,6 +176,12 @@ public:
*/
void removeListener (FileBrowserListener* listener);
/** Returns a platform-specific list of names and paths for some suggested places the user
might want to use as root folders.
The list returned contains empty strings to indicate section breaks.
@see getRoots()
*/
static void getDefaultRoots (StringArray& rootNames, StringArray& rootPaths);
//==============================================================================
/** @internal */
@@ -215,7 +221,9 @@ public:
protected:
/** Returns a list of names and paths for the default places the user might want to look.
Use an empty string to indicate a section break.
By default this just calls getDefaultRoots(), but you may want to override it to
return a custom list.
*/
virtual void getRoots (StringArray& rootNames, StringArray& rootPaths);


Loading…
Cancel
Save