mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-04 03:40:07 +00:00
Deprecated File::separator and File::separatorString, replacing them by static getter functions, so that File methods can be safely used in static constructors without order-of-initialisation problems
This commit is contained in:
parent
15871dd890
commit
2ee168ad46
8 changed files with 64 additions and 48 deletions
|
|
@ -222,7 +222,7 @@ void FileBrowserComponent::setRoot (const File& newRootDirectory)
|
|||
String path (newRootDirectory.getFullPathName());
|
||||
|
||||
if (path.isEmpty())
|
||||
path = File::separatorString;
|
||||
path = File::getSeparatorString();
|
||||
|
||||
StringArray rootNames, rootPaths;
|
||||
getRoots (rootNames, rootPaths);
|
||||
|
|
@ -248,12 +248,13 @@ void FileBrowserComponent::setRoot (const File& newRootDirectory)
|
|||
currentRoot = newRootDirectory;
|
||||
fileList->setDirectory (currentRoot, true, true);
|
||||
|
||||
if (FileTreeComponent* tree = dynamic_cast<FileTreeComponent*> (fileListComponent.get()))
|
||||
if (auto* tree = dynamic_cast<FileTreeComponent*> (fileListComponent.get()))
|
||||
tree->refresh();
|
||||
|
||||
String currentRootName (currentRoot.getFullPathName());
|
||||
auto currentRootName = currentRoot.getFullPathName();
|
||||
|
||||
if (currentRootName.isEmpty())
|
||||
currentRootName = File::separatorString;
|
||||
currentRootName = File::getSeparatorString();
|
||||
|
||||
currentPathBox.setText (currentRootName, dontSendNotification);
|
||||
|
||||
|
|
@ -431,9 +432,9 @@ void FileBrowserComponent::textEditorTextChanged (TextEditor&)
|
|||
|
||||
void FileBrowserComponent::textEditorReturnKeyPressed (TextEditor&)
|
||||
{
|
||||
if (filenameBox.getText().containsChar (File::separator))
|
||||
if (filenameBox.getText().containsChar (File::getSeparatorChar()))
|
||||
{
|
||||
const File f (currentRoot.getChildFile (filenameBox.getText()));
|
||||
auto f = currentRoot.getChildFile (filenameBox.getText());
|
||||
|
||||
if (f.isDirectory())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue