diff --git a/examples/Demo/Source/Demos/AudioSynthesiserDemo.cpp b/examples/Demo/Source/Demos/AudioSynthesiserDemo.cpp index 80a8a279a3..1a41b03ab4 100644 --- a/examples/Demo/Source/Demos/AudioSynthesiserDemo.cpp +++ b/examples/Demo/Source/Demos/AudioSynthesiserDemo.cpp @@ -260,7 +260,7 @@ public: audioSourcePlayer.setSource (&synthAudioSource); deviceManager.addAudioCallback (&audioSourcePlayer); - deviceManager.addMidiInputCallback (String::empty, &(synthAudioSource.midiCollector)); + deviceManager.addMidiInputCallback (String(), &(synthAudioSource.midiCollector)); setOpaque (true); setSize (640, 480); @@ -269,7 +269,7 @@ public: ~AudioSynthesiserDemo() { audioSourcePlayer.setSource (nullptr); - deviceManager.removeMidiInputCallback (String::empty, &(synthAudioSource.midiCollector)); + deviceManager.removeMidiInputCallback (String(), &(synthAudioSource.midiCollector)); deviceManager.removeAudioCallback (&audioSourcePlayer); deviceManager.removeAudioCallback (&liveAudioDisplayComp); } diff --git a/examples/Demo/Source/Demos/CodeEditorDemo.cpp b/examples/Demo/Source/Demos/CodeEditorDemo.cpp index 836f27feaf..d37bce4e45 100644 --- a/examples/Demo/Source/Demos/CodeEditorDemo.cpp +++ b/examples/Demo/Source/Demos/CodeEditorDemo.cpp @@ -31,7 +31,7 @@ class CodeEditorDemo : public Component, { public: CodeEditorDemo() - : fileChooser ("File", File::nonexistent, true, false, false, + : fileChooser ("File", File(), true, false, false, "*.cpp;*.h;*.hpp;*.c;*.mm;*.m", String(), "Choose a C++ file to open it in the editor") { diff --git a/examples/Demo/Source/Demos/FontsDemo.cpp b/examples/Demo/Source/Demos/FontsDemo.cpp index 151dec2242..98ed1831a0 100644 --- a/examples/Demo/Source/Demos/FontsDemo.cpp +++ b/examples/Demo/Source/Demos/FontsDemo.cpp @@ -34,9 +34,9 @@ class FontsDemo : public Component, { public: FontsDemo() - : heightLabel (String::empty, "Height:"), - kerningLabel (String::empty, "Kerning:"), - scaleLabel (String::empty, "Scale:"), + : heightLabel (String(), "Height:"), + kerningLabel (String(), "Kerning:"), + scaleLabel (String(), "Scale:"), styleLabel ("Style"), boldToggle ("Bold"), italicToggle ("Italic") diff --git a/examples/Demo/Source/Demos/GraphicsDemo.cpp b/examples/Demo/Source/Demos/GraphicsDemo.cpp index 7ca7e6daff..29224bf247 100644 --- a/examples/Demo/Source/Demos/GraphicsDemo.cpp +++ b/examples/Demo/Source/Demos/GraphicsDemo.cpp @@ -395,7 +395,7 @@ class ImagesRenderingDemo : public GraphicsDemoBase { public: ImagesRenderingDemo (ControllersComponent& cc, bool argb_, bool tiled_) - : GraphicsDemoBase (cc, String ("Images") + (argb_ ? ": ARGB" : ": RGB") + (tiled_ ? " Tiled" : String::empty )), + : GraphicsDemoBase (cc, String ("Images") + (argb_ ? ": ARGB" : ": RGB") + (tiled_ ? " Tiled" : String() )), isArgb (argb_), isTiled (tiled_) { argbImage = ImageFileFormat::loadFrom (BinaryData::juce_icon_png, (size_t) BinaryData::juce_icon_pngSize); diff --git a/examples/Demo/Source/Demos/MDIDemo.cpp b/examples/Demo/Source/Demos/MDIDemo.cpp index 1a6dcfa299..cc060ca381 100644 --- a/examples/Demo/Source/Demos/MDIDemo.cpp +++ b/examples/Demo/Source/Demos/MDIDemo.cpp @@ -86,7 +86,7 @@ public: File getLastDocumentOpened() override { // not interested in this for now - return File::nonexistent; + return File(); } void setLastDocumentOpened (const File& /*file*/) override diff --git a/examples/Demo/Source/Demos/OpenGLDemo.cpp b/examples/Demo/Source/Demos/OpenGLDemo.cpp index 71a9f00f8d..af16b3eb16 100644 --- a/examples/Demo/Source/Demos/OpenGLDemo.cpp +++ b/examples/Demo/Source/Demos/OpenGLDemo.cpp @@ -836,8 +836,8 @@ struct OpenGLDemoClasses controlsOverlay->statusLabel.setText (statusText, dontSendNotification); - newVertexShader = String::empty; - newFragmentShader = String::empty; + newVertexShader = String(); + newFragmentShader = String(); } } diff --git a/examples/Demo/Source/Demos/OpenGLDemo2D.cpp b/examples/Demo/Source/Demos/OpenGLDemo2D.cpp index 0216195f05..7be659ae80 100644 --- a/examples/Demo/Source/Demos/OpenGLDemo2D.cpp +++ b/examples/Demo/Source/Demos/OpenGLDemo2D.cpp @@ -97,7 +97,7 @@ public: if (shader != nullptr) { - statusLabel.setText (String::empty, dontSendNotification); + statusLabel.setText (String(), dontSendNotification); shader->fillRect (g.getInternalContext(), getLocalBounds()); } diff --git a/examples/Demo/Source/Demos/VideoDemo.cpp b/examples/Demo/Source/Demos/VideoDemo.cpp index 2d29227f07..8ccc4a2c69 100644 --- a/examples/Demo/Source/Demos/VideoDemo.cpp +++ b/examples/Demo/Source/Demos/VideoDemo.cpp @@ -35,8 +35,8 @@ class MovieComponentWithFileBrowser : public Component, public: MovieComponentWithFileBrowser() : isDragOver (false), - fileChooser ("movie", File::nonexistent, true, false, false, - "*", String::empty, "(choose a video file to play)") + fileChooser ("movie", File(), true, false, false, + "*", String(), "(choose a video file to play)") { addAndMakeVisible (videoComp); diff --git a/examples/Demo/Source/Demos/WavefrontObjParser.h b/examples/Demo/Source/Demos/WavefrontObjParser.h index b6c425eca4..a90a9a1a2a 100644 --- a/examples/Demo/Source/Demos/WavefrontObjParser.h +++ b/examples/Demo/Source/Demos/WavefrontObjParser.h @@ -242,7 +242,7 @@ private: static String::CharPointerType findEndOfFaceToken (String::CharPointerType t) noexcept { - return CharacterFunctions::findEndOfToken (t, CharPointer_ASCII ("/ \t"), String::empty.getCharPointer()); + return CharacterFunctions::findEndOfToken (t, CharPointer_ASCII ("/ \t"), String().getCharPointer()); } }; diff --git a/examples/Demo/Source/Demos/WidgetsDemo.cpp b/examples/Demo/Source/Demos/WidgetsDemo.cpp index 7181e86ec5..f5886f8802 100644 --- a/examples/Demo/Source/Demos/WidgetsDemo.cpp +++ b/examples/Demo/Source/Demos/WidgetsDemo.cpp @@ -453,11 +453,11 @@ class ToolbarDemoComp : public Component, { public: ToolbarDemoComp() - : depthLabel (String::empty, "Toolbar depth:"), - infoLabel (String::empty, "As well as showing off toolbars, this demo illustrates how to store " - "a set of SVG files in a Zip file, embed that in your application, and read " - "them back in at runtime.\n\nThe icon images here are taken from the open-source " - "Tango icon project."), + : depthLabel (String(), "Toolbar depth:"), + infoLabel (String(), "As well as showing off toolbars, this demo illustrates how to store " + "a set of SVG files in a Zip file, embed that in your application, and read " + "them back in at runtime.\n\nThe icon images here are taken from the open-source " + "Tango icon project."), orientationButton ("Vertical/Horizontal"), customiseButton ("Customise...") { diff --git a/examples/Demo/Source/Demos/XMLandJSONDemo.cpp b/examples/Demo/Source/Demos/XMLandJSONDemo.cpp index 0914e5823e..b31a182441 100644 --- a/examples/Demo/Source/Demos/XMLandJSONDemo.cpp +++ b/examples/Demo/Source/Demos/XMLandJSONDemo.cpp @@ -356,9 +356,9 @@ private: { switch (type) { - case xml: codeDocument.replaceAllContent (BinaryData::treedemo_xml); break; - case json: codeDocument.replaceAllContent (BinaryData::juce_module_info); break; - default: codeDocument.replaceAllContent (String::empty); break; + case xml: codeDocument.replaceAllContent (BinaryData::treedemo_xml); break; + case json: codeDocument.replaceAllContent (BinaryData::juce_module_info); break; + default: codeDocument.replaceAllContent (String()); break; } } diff --git a/examples/Demo/Source/MainWindow.cpp b/examples/Demo/Source/MainWindow.cpp index ea2e6aa638..0900af8c51 100644 --- a/examples/Demo/Source/MainWindow.cpp +++ b/examples/Demo/Source/MainWindow.cpp @@ -367,32 +367,32 @@ private: } case MainAppWindow::useLookAndFeelV1: - result.setInfo ("Use LookAndFeel_V1", String::empty, generalCategory, 0); + result.setInfo ("Use LookAndFeel_V1", String(), generalCategory, 0); result.addDefaultKeypress ('i', ModifierKeys::commandModifier); result.setTicked (isLookAndFeelSelected()); break; case MainAppWindow::useLookAndFeelV2: - result.setInfo ("Use LookAndFeel_V2", String::empty, generalCategory, 0); + result.setInfo ("Use LookAndFeel_V2", String(), generalCategory, 0); result.addDefaultKeypress ('o', ModifierKeys::commandModifier); result.setTicked (isLookAndFeelSelected()); break; case MainAppWindow::useLookAndFeelV3: - result.setInfo ("Use LookAndFeel_V3", String::empty, generalCategory, 0); + result.setInfo ("Use LookAndFeel_V3", String(), generalCategory, 0); result.addDefaultKeypress ('p', ModifierKeys::commandModifier); result.setTicked (isLookAndFeelSelected()); break; case MainAppWindow::toggleRepaintDebugging: - result.setInfo ("Toggle repaint display", String::empty, generalCategory, 0); + result.setInfo ("Toggle repaint display", String(), generalCategory, 0); result.addDefaultKeypress ('r', ModifierKeys()); result.setTicked (juceDemoRepaintDebuggingActive); break; case MainAppWindow::useNativeTitleBar: { - result.setInfo ("Use native window title bar", String::empty, generalCategory, 0); + result.setInfo ("Use native window title bar", String(), generalCategory, 0); result.addDefaultKeypress ('n', ModifierKeys::commandModifier); bool nativeTitlebar = false; @@ -405,7 +405,7 @@ private: #if ! JUCE_LINUX case MainAppWindow::goToKioskMode: - result.setInfo ("Show full-screen kiosk mode", String::empty, generalCategory, 0); + result.setInfo ("Show full-screen kiosk mode", String(), generalCategory, 0); result.addDefaultKeypress ('f', ModifierKeys::commandModifier); result.setTicked (Desktop::getInstance().getKioskModeComponent() != 0); break; diff --git a/examples/MPETest/Source/MPESetupComponent.h b/examples/MPETest/Source/MPESetupComponent.h index 3f68caad82..951992975c 100644 --- a/examples/MPETest/Source/MPESetupComponent.h +++ b/examples/MPETest/Source/MPESetupComponent.h @@ -50,18 +50,18 @@ public: //============================================================================== MPESetupComponent() - : masterChannelLabel (String::empty, "Master channel:"), - noteChannelsLabel (String::empty, "Nr. of note channels:"), - masterPitchbendRangeLabel (String::empty, "Master pitchbend range (semitones):"), - notePitchbendRangeLabel (String::empty, "Note pitchbend range (semitones):"), + : masterChannelLabel (String(), "Master channel:"), + noteChannelsLabel (String(), "Nr. of note channels:"), + masterPitchbendRangeLabel (String(), "Master pitchbend range (semitones):"), + notePitchbendRangeLabel (String(), "Note pitchbend range (semitones):"), addZoneButton ("Add this zone"), clearAllZonesButton ("Clear all zones"), - legacyStartChannelLabel (String::empty, "First channel:"), - legacyEndChannelLabel (String::empty, "Last channel:"), - legacyPitchbendRangeLabel (String::empty, "Pitchbend range (semitones):"), + legacyStartChannelLabel (String(), "First channel:"), + legacyEndChannelLabel (String(), "Last channel:"), + legacyPitchbendRangeLabel (String(), "Pitchbend range (semitones):"), legacyModeEnabledToggle ("Enable Legacy Mode"), voiceStealingEnabledToggle ("Enable synth voice stealing"), - numberOfVoicesLabel (String::empty, "Number of synth voices") + numberOfVoicesLabel (String(), "Number of synth voices") { initialiseComboBoxWithConsecutiveIntegers (masterChannel, masterChannelLabel, 1, 15, defaultMasterChannel); diff --git a/examples/MPETest/Source/MainComponent.h b/examples/MPETest/Source/MainComponent.h index f1c35c0073..c22143dde2 100644 --- a/examples/MPETest/Source/MainComponent.h +++ b/examples/MPETest/Source/MainComponent.h @@ -41,8 +41,8 @@ public: { setLookAndFeel (&lookAndFeel); setSize (880, 720); - audioDeviceManager.initialise (0, 2, 0, true, String::empty, 0); - audioDeviceManager.addMidiInputCallback(String::empty, this); + audioDeviceManager.initialise (0, 2, 0, true, String(), 0); + audioDeviceManager.addMidiInputCallback (String(), this); audioDeviceManager.addAudioCallback (this); addAndMakeVisible (audioSetupComp); @@ -65,7 +65,7 @@ public: ~MainComponent() { - audioDeviceManager.removeMidiInputCallback (String::empty, this); + audioDeviceManager.removeMidiInputCallback (String(), this); } //============================================================================== diff --git a/examples/MidiTest/Source/MainComponent.cpp b/examples/MidiTest/Source/MainComponent.cpp index 5cd5704059..881da46aa5 100644 --- a/examples/MidiTest/Source/MainComponent.cpp +++ b/examples/MidiTest/Source/MainComponent.cpp @@ -167,7 +167,7 @@ MainContentComponent::MainContentComponent () midiMonitor.setScrollbarsShown (true); midiMonitor.setCaretVisible (false); midiMonitor.setPopupMenuEnabled (false); - midiMonitor.setText (String::empty); + midiMonitor.setText (String()); addAndMakeVisible (midiMonitor); if (! BluetoothMidiDevicePairingDialogue::isAvailable()) diff --git a/examples/OpenGLAppExample/Source/Resources/WavefrontObjParser.h b/examples/OpenGLAppExample/Source/Resources/WavefrontObjParser.h index d9198b895f..f62126ec1a 100644 --- a/examples/OpenGLAppExample/Source/Resources/WavefrontObjParser.h +++ b/examples/OpenGLAppExample/Source/Resources/WavefrontObjParser.h @@ -243,7 +243,7 @@ private: static String::CharPointerType findEndOfFaceToken (String::CharPointerType t) noexcept { - return CharacterFunctions::findEndOfToken (t, CharPointer_ASCII ("/ \t"), String::empty.getCharPointer()); + return CharacterFunctions::findEndOfToken (t, CharPointer_ASCII ("/ \t"), String().getCharPointer()); } }; diff --git a/examples/audio plugin demo/Source/PluginEditor.cpp b/examples/audio plugin demo/Source/PluginEditor.cpp index 384b0f2efb..8639737b64 100644 --- a/examples/audio plugin demo/Source/PluginEditor.cpp +++ b/examples/audio plugin demo/Source/PluginEditor.cpp @@ -59,9 +59,9 @@ public: JuceDemoPluginAudioProcessorEditor::JuceDemoPluginAudioProcessorEditor (JuceDemoPluginAudioProcessor& owner) : AudioProcessorEditor (owner), midiKeyboard (owner.keyboardState, MidiKeyboardComponent::horizontalKeyboard), - timecodeDisplayLabel (String::empty), - gainLabel (String::empty, "Throughput level:"), - delayLabel (String::empty, "Delay:") + timecodeDisplayLabel (String()), + gainLabel (String(), "Throughput level:"), + delayLabel (String(), "Delay:") { // add some sliders.. addAndMakeVisible (gainSlider = new ParameterSlider (*owner.gainParam)); diff --git a/examples/audio plugin host/Source/FilterGraph.cpp b/examples/audio plugin host/Source/FilterGraph.cpp index b79c2ad400..6c5f058b1a 100644 --- a/examples/audio plugin host/Source/FilterGraph.cpp +++ b/examples/audio plugin host/Source/FilterGraph.cpp @@ -256,7 +256,7 @@ Result FilterGraph::saveDocument (const File& file) { ScopedPointer xml (createXml()); - if (! xml->writeToFile (file, String::empty)) + if (! xml->writeToFile (file, String())) return Result::fail ("Couldn't write to the file"); return Result::ok(); diff --git a/examples/audio plugin host/Source/GraphEditorPanel.cpp b/examples/audio plugin host/Source/GraphEditorPanel.cpp index 68ec082bf4..7394488768 100644 --- a/examples/audio plugin host/Source/GraphEditorPanel.cpp +++ b/examples/audio plugin host/Source/GraphEditorPanel.cpp @@ -969,7 +969,7 @@ void GraphEditorPanel::dragConnector (const MouseEvent& e) if (draggingConnector != nullptr) { - draggingConnector->setTooltip (String::empty); + draggingConnector->setTooltip (String()); int x = e2.x; int y = e2.y; @@ -1013,7 +1013,7 @@ void GraphEditorPanel::endDraggingConnector (const MouseEvent& e) if (draggingConnector == nullptr) return; - draggingConnector->setTooltip (String::empty); + draggingConnector->setTooltip (String()); const MouseEvent e2 (e.getEventRelativeTo (this)); @@ -1108,7 +1108,7 @@ GraphDocumentComponent::GraphDocumentComponent (AudioPluginFormatManager& format addAndMakeVisible (statusBar = new TooltipBar()); deviceManager->addAudioCallback (&graphPlayer); - deviceManager->addMidiInputCallback (String::empty, &graphPlayer.getMidiMessageCollector()); + deviceManager->addMidiInputCallback (String(), &graphPlayer.getMidiMessageCollector()); graphPanel->updateComponents(); } @@ -1143,7 +1143,7 @@ void GraphDocumentComponent::unfocusKeyboardComponent() void GraphDocumentComponent::releaseGraph() { deviceManager->removeAudioCallback (&graphPlayer); - deviceManager->removeMidiInputCallback (String::empty, &graphPlayer.getMidiMessageCollector()); + deviceManager->removeMidiInputCallback (String(), &graphPlayer.getMidiMessageCollector()); deviceManager->removeChangeListener (graphPanel); deleteAllChildren(); diff --git a/examples/audio plugin host/Source/MainHostWindow.cpp b/examples/audio plugin host/Source/MainHostWindow.cpp index 6ff23ecb87..63cbe225c6 100644 --- a/examples/audio plugin host/Source/MainHostWindow.cpp +++ b/examples/audio plugin host/Source/MainHostWindow.cpp @@ -387,12 +387,12 @@ void MainHostWindow::getCommandInfo (const CommandID commandID, ApplicationComma break; case CommandIDs::showPluginListEditor: - result.setInfo ("Edit the list of available plug-Ins...", String::empty, category, 0); + result.setInfo ("Edit the list of available plug-Ins...", String(), category, 0); result.addDefaultKeypress ('p', ModifierKeys::commandModifier); break; case CommandIDs::showAudioSettings: - result.setInfo ("Change the audio device settings", String::empty, category, 0); + result.setInfo ("Change the audio device settings", String(), category, 0); result.addDefaultKeypress ('a', ModifierKeys::commandModifier); break; @@ -401,7 +401,7 @@ void MainHostWindow::getCommandInfo (const CommandID commandID, ApplicationComma break; case CommandIDs::aboutBox: - result.setInfo ("About...", String::empty, category, 0); + result.setInfo ("About...", String(), category, 0); break; case CommandIDs::allWindowsForward: @@ -437,7 +437,7 @@ bool MainHostWindow::perform (const InvocationInfo& info) case CommandIDs::saveAs: if (graphEditor != nullptr && graphEditor->graph != nullptr) - graphEditor->graph->saveAs (File::nonexistent, true, true, true); + graphEditor->graph->saveAs (File(), true, true, true); break; case CommandIDs::showPluginListEditor: @@ -577,6 +577,6 @@ bool MainHostWindow::isDoublePrecisionProcessing() void MainHostWindow::updatePrecisionMenuItem (ApplicationCommandInfo& info) { - info.setInfo ("Double floating point precision rendering", String::empty, "General", 0); + info.setInfo ("Double floating point precision rendering", String(), "General", 0); info.setTicked (isDoublePrecisionProcessing()); } diff --git a/extras/Projucer/Source/Application/jucer_AppearanceSettings.cpp b/extras/Projucer/Source/Application/jucer_AppearanceSettings.cpp index 3366b4d3b7..1bf933611f 100644 --- a/extras/Projucer/Source/Application/jucer_AppearanceSettings.cpp +++ b/extras/Projucer/Source/Application/jucer_AppearanceSettings.cpp @@ -170,7 +170,7 @@ bool AppearanceSettings::readFromFile (const File& file) bool AppearanceSettings::writeToFile (const File& file) const { const ScopedPointer xml (settings.createXml()); - return xml != nullptr && xml->writeToFile (file, String::empty); + return xml != nullptr && xml->writeToFile (file, String()); } Font AppearanceSettings::getDefaultCodeFont() diff --git a/extras/Projucer/Source/Application/jucer_GlobalPreferences.cpp b/extras/Projucer/Source/Application/jucer_GlobalPreferences.cpp index 3d7fd0a5a8..c113c598f1 100644 --- a/extras/Projucer/Source/Application/jucer_GlobalPreferences.cpp +++ b/extras/Projucer/Source/Application/jucer_GlobalPreferences.cpp @@ -77,7 +77,7 @@ Identifier PathSettingsTab::getKeyForPropertyComponent (TextPropertyComponent* c // this property component does not have a key associated to it! jassertfalse; - return String::empty; + return String(); } Component* PathSettingsTab::getContent() @@ -286,7 +286,7 @@ struct AppearanceEditor StringArray names; names.add (""); - names.add (String::empty); + names.add (String()); names.addArray (getAppSettings().monospacedFontNames); return new ChoicePropertyComponent (Value (new FontNameValueSource (value)), diff --git a/extras/Projucer/Source/Application/jucer_OpenDocumentManager.cpp b/extras/Projucer/Source/Application/jucer_OpenDocumentManager.cpp index 2c185733a2..bbc46d09dc 100644 --- a/extras/Projucer/Source/Application/jucer_OpenDocumentManager.cpp +++ b/extras/Projucer/Source/Application/jucer_OpenDocumentManager.cpp @@ -62,7 +62,7 @@ public: Component* createEditor() override { return new ItemPreviewComponent (file); } Component* createViewer() override { return createEditor(); } void fileHasBeenRenamed (const File& newFile) override { file = newFile; } - String getState() const override { return String::empty; } + String getState() const override { return String(); } void restoreState (const String&) override {} String getType() const override diff --git a/extras/Projucer/Source/Application/jucer_OpenDocumentManager.h b/extras/Projucer/Source/Application/jucer_OpenDocumentManager.h index 43a34e98bb..b5f8a19a49 100644 --- a/extras/Projucer/Source/Application/jucer_OpenDocumentManager.h +++ b/extras/Projucer/Source/Application/jucer_OpenDocumentManager.h @@ -62,7 +62,7 @@ public: virtual void fileHasBeenRenamed (const File& newFile) = 0; virtual String getState() const = 0; virtual void restoreState (const String& state) = 0; - virtual File getCounterpartFile() const { return File::nonexistent; } + virtual File getCounterpartFile() const { return File(); } }; //============================================================================== diff --git a/extras/Projucer/Source/Code Editor/jucer_SourceCodeEditor.cpp b/extras/Projucer/Source/Code Editor/jucer_SourceCodeEditor.cpp index 32367158fd..1afb136797 100644 --- a/extras/Projucer/Source/Code Editor/jucer_SourceCodeEditor.cpp +++ b/extras/Projucer/Source/Code Editor/jucer_SourceCodeEditor.cpp @@ -639,7 +639,7 @@ void CppCodeEditorComponent::insertComponentClass() const char* classNameField = "Class Name"; - aw.addTextEditor (classNameField, String::empty, String::empty, false); + aw.addTextEditor (classNameField, String(), String(), false); aw.addButton (TRANS ("Insert Code"), 1, KeyPress (KeyPress::returnKey)); aw.addButton (TRANS ("Cancel"), 0, KeyPress (KeyPress::escapeKey)); diff --git a/extras/Projucer/Source/Code Editor/jucer_SourceCodeEditor.h b/extras/Projucer/Source/Code Editor/jucer_SourceCodeEditor.h index 5106004b79..62cb112b7b 100644 --- a/extras/Projucer/Source/Code Editor/jucer_SourceCodeEditor.h +++ b/extras/Projucer/Source/Code Editor/jucer_SourceCodeEditor.h @@ -46,7 +46,7 @@ public: bool needsSaving() const override { return codeDoc != nullptr && codeDoc->hasChangedSinceSavePoint(); } bool hasFileBeenModifiedExternally() override { return modDetector.hasBeenModified(); } void fileHasBeenRenamed (const File& newFile) override { modDetector.fileHasBeenRenamed (newFile); } - String getState() const override { return lastState != nullptr ? lastState->toString() : String::empty; } + String getState() const override { return lastState != nullptr ? lastState->toString() : String(); } void restoreState (const String& state) override { lastState = new CodeEditorComponent::State (state); } File getCounterpartFile() const override diff --git a/extras/Projucer/Source/ComponentEditor/components/jucer_ComboBoxHandler.h b/extras/Projucer/Source/ComponentEditor/components/jucer_ComboBoxHandler.h index e328d9af55..288406eb4f 100644 --- a/extras/Projucer/Source/ComponentEditor/components/jucer_ComboBoxHandler.h +++ b/extras/Projucer/Source/ComponentEditor/components/jucer_ComboBoxHandler.h @@ -55,14 +55,14 @@ public: if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout)) return false; - ComboBox defaultBox (String::empty); + ComboBox defaultBox; ComboBox* const c = dynamic_cast (comp); jassert (c != nullptr); c->setEditableText (xml.getBoolAttribute ("editable", defaultBox.isTextEditable())); c->setJustificationType (Justification (xml.getIntAttribute ("layout", defaultBox.getJustificationType().getFlags()))); - c->getProperties().set ("items", xml.getStringAttribute ("items", String::empty)); + c->getProperties().set ("items", xml.getStringAttribute ("items", String())); c->setTextWhenNothingSelected (xml.getStringAttribute ("textWhenNonSelected", defaultBox.getTextWhenNothingSelected())); c->setTextWhenNoChoicesAvailable (xml.getStringAttribute ("textWhenNoItems", defaultBox.getTextWhenNoChoicesAvailable())); diff --git a/extras/Projucer/Source/ComponentEditor/components/jucer_ComponentTypeHandler.cpp b/extras/Projucer/Source/ComponentEditor/components/jucer_ComponentTypeHandler.cpp index f9687e789e..16bdedeebe 100644 --- a/extras/Projucer/Source/ComponentEditor/components/jucer_ComponentTypeHandler.cpp +++ b/extras/Projucer/Source/ComponentEditor/components/jucer_ComponentTypeHandler.cpp @@ -196,7 +196,7 @@ bool ComponentTypeHandler::restoreFromXml (const XmlElement& xml, for (int i = 0; i < colours.size(); ++i) { - const String col (xml.getStringAttribute (colours[i]->xmlTagName, String::empty)); + const String col (xml.getStringAttribute (colours[i]->xmlTagName, String())); if (col.isNotEmpty()) comp->setColour (colours[i]->colourId, Colour::fromString (col)); @@ -518,12 +518,12 @@ void ComponentTypeHandler::fillInResizeCode (GeneratedCode& code, Component* com if (pos.rect.isPositionAbsolute()) code.constructorCode += r + "\n"; else - code.getCallbackCode (String::empty, "void", "resized()", false) += r; + code.getCallbackCode (String(), "void", "resized()", false) += r; } String ComponentTypeHandler::getCreationParameters (GeneratedCode&, Component*) { - return String::empty; + return String(); } void ComponentTypeHandler::fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName) diff --git a/extras/Projucer/Source/ComponentEditor/components/jucer_GenericComponentHandler.h b/extras/Projucer/Source/ComponentEditor/components/jucer_GenericComponentHandler.h index 6d4e9940c0..3e3301d8a2 100644 --- a/extras/Projucer/Source/ComponentEditor/components/jucer_GenericComponentHandler.h +++ b/extras/Projucer/Source/ComponentEditor/components/jucer_GenericComponentHandler.h @@ -93,7 +93,7 @@ public: return false; ((GenericComponent*) comp)->actualClassName = xml.getStringAttribute ("class", "Component"); - ((GenericComponent*) comp)->constructorParams = xml.getStringAttribute ("params", String::empty); + ((GenericComponent*) comp)->constructorParams = xml.getStringAttribute ("params", String()); return true; } diff --git a/extras/Projucer/Source/ComponentEditor/components/jucer_GroupComponentHandler.h b/extras/Projucer/Source/ComponentEditor/components/jucer_GroupComponentHandler.h index 45bea8ee10..4e9e4c36aa 100644 --- a/extras/Projucer/Source/ComponentEditor/components/jucer_GroupComponentHandler.h +++ b/extras/Projucer/Source/ComponentEditor/components/jucer_GroupComponentHandler.h @@ -44,7 +44,7 @@ public: XmlElement* e = ComponentTypeHandler::createXmlFor (comp, layout); e->setAttribute ("title", g->getText()); - GroupComponent defaultComp (String::empty, String::empty); + GroupComponent defaultComp; if (g->getTextLabelPosition().getFlags() != defaultComp.getTextLabelPosition().getFlags()) e->setAttribute ("textpos", g->getTextLabelPosition().getFlags()); @@ -82,7 +82,7 @@ public: String s; - GroupComponent defaultComp (String::empty, String::empty); + GroupComponent defaultComp; if (g->getTextLabelPosition().getFlags() != defaultComp.getTextLabelPosition().getFlags()) { diff --git a/extras/Projucer/Source/ComponentEditor/components/jucer_ImageButtonHandler.h b/extras/Projucer/Source/ComponentEditor/components/jucer_ImageButtonHandler.h index a7d17d925c..e6e8419e55 100644 --- a/extras/Projucer/Source/ComponentEditor/components/jucer_ImageButtonHandler.h +++ b/extras/Projucer/Source/ComponentEditor/components/jucer_ImageButtonHandler.h @@ -101,15 +101,15 @@ public: setImageKeepProportions (l, ib, xml.getBoolAttribute ("keepProportions", true), false); - setImageResource (l, ib, normalImage, xml.getStringAttribute ("resourceNormal", String::empty), false); + setImageResource (l, ib, normalImage, xml.getStringAttribute ("resourceNormal", String()), false); setImageOpacity (l, ib, normalImage, (float) xml.getDoubleAttribute ("opacityNormal", 1.0f), false); setImageColour (l, ib, normalImage, Colour::fromString (xml.getStringAttribute ("colourNormal", "0")), false); - setImageResource (l, ib, overImage, xml.getStringAttribute ("resourceOver", String::empty), false); + setImageResource (l, ib, overImage, xml.getStringAttribute ("resourceOver", String()), false); setImageOpacity (l, ib, overImage, (float) xml.getDoubleAttribute ("opacityOver", 1.0f), false); setImageColour (l, ib, overImage, Colour::fromString (xml.getStringAttribute ("colourOver", "0")), false); - setImageResource (l, ib, downImage, xml.getStringAttribute ("resourceDown", String::empty), false); + setImageResource (l, ib, downImage, xml.getStringAttribute ("resourceDown", String()), false); setImageOpacity (l, ib, downImage, (float) xml.getDoubleAttribute ("opacityDown", 1.0f), false); setImageColour (l, ib, downImage, Colour::fromString (xml.getStringAttribute ("colourDown", "0")), false); diff --git a/extras/Projucer/Source/ComponentEditor/components/jucer_LabelHandler.h b/extras/Projucer/Source/ComponentEditor/components/jucer_LabelHandler.h index c71fce659c..bbfa309908 100644 --- a/extras/Projucer/Source/ComponentEditor/components/jucer_LabelHandler.h +++ b/extras/Projucer/Source/ComponentEditor/components/jucer_LabelHandler.h @@ -68,7 +68,7 @@ public: if (! ComponentTypeHandler::restoreFromXml (xml, comp, layout)) return false; - Label defaultLabel (String::empty, String::empty); + Label defaultLabel; Font font; font.setHeight ((float) xml.getDoubleAttribute ("fontsize", 15.0)); diff --git a/extras/Projucer/Source/ComponentEditor/components/jucer_TabbedComponentHandler.h b/extras/Projucer/Source/ComponentEditor/components/jucer_TabbedComponentHandler.h index 37933ca709..399a35890c 100644 --- a/extras/Projucer/Source/ComponentEditor/components/jucer_TabbedComponentHandler.h +++ b/extras/Projucer/Source/ComponentEditor/components/jucer_TabbedComponentHandler.h @@ -147,7 +147,7 @@ public: default: jassertfalse; break; } - return String::empty; + return String(); } void fillInCreationCode (GeneratedCode& code, Component* component, const String& memberVariableName) @@ -275,7 +275,7 @@ public: TabDemoContentComp* const tdc = dynamic_cast (tc->getTabContentComponent (tabIndex)); jassert (tdc != nullptr); - return tdc != 0 ? tdc->contentClassName : String::empty; + return tdc != 0 ? tdc->contentClassName : String(); } static void setTabClassName (TabbedComponent* tc, int tabIndex, const String& newName) @@ -295,7 +295,7 @@ public: TabDemoContentComp* const tdc = dynamic_cast (tc->getTabContentComponent (tabIndex)); jassert (tdc != nullptr); - return tdc != 0 ? tdc->constructorParams : String::empty; + return tdc != 0 ? tdc->constructorParams : String(); } static void setTabConstructorParams (TabbedComponent* tc, int tabIndex, const String& newParams) @@ -315,7 +315,7 @@ public: TabDemoContentComp* const tdc = dynamic_cast (tc->getTabContentComponent (tabIndex)); jassert (tdc != nullptr); - return tdc != 0 ? tdc->jucerComponentFile : String::empty; + return tdc != 0 ? tdc->jucerComponentFile : String(); } static void setTabJucerFile (TabbedComponent* tc, int tabIndex, const String& newFile) diff --git a/extras/Projucer/Source/ComponentEditor/components/jucer_ViewportHandler.h b/extras/Projucer/Source/ComponentEditor/components/jucer_ViewportHandler.h index 308734339f..4afacc9585 100644 --- a/extras/Projucer/Source/ComponentEditor/components/jucer_ViewportHandler.h +++ b/extras/Projucer/Source/ComponentEditor/components/jucer_ViewportHandler.h @@ -66,7 +66,7 @@ public: v->setScrollBarThickness (xml.getIntAttribute ("scrollbarThickness", defaultViewport.getScrollBarThickness())); - setViewportJucerComponentFile (v, xml.getStringAttribute ("jucerFile", String::empty)); + setViewportJucerComponentFile (v, xml.getStringAttribute ("jucerFile", String())); setViewportGenericComponentClass (v, xml.getStringAttribute ("contentClass")); setViewportContentType (v, xml.getIntAttribute ("contentType", 0)); setViewportConstructorParams (v, xml.getStringAttribute ("constructorParams")); @@ -150,7 +150,7 @@ public: } else { - classNm = String::empty; + classNm = String(); } } @@ -505,7 +505,7 @@ private: const String filename (getViewportJucerComponentFile (component)); if (filename.isEmpty()) - return File::nonexistent; + return File(); return document.getCppFile().getSiblingFile (filename); } diff --git a/extras/Projucer/Source/ComponentEditor/documents/jucer_ButtonDocument.cpp b/extras/Projucer/Source/ComponentEditor/documents/jucer_ButtonDocument.cpp index db6fe13956..597a3a2579 100644 --- a/extras/Projucer/Source/ComponentEditor/documents/jucer_ButtonDocument.cpp +++ b/extras/Projucer/Source/ComponentEditor/documents/jucer_ButtonDocument.cpp @@ -275,7 +275,7 @@ class ButtonTestComponent : public Button { public: ButtonTestComponent (ButtonDocument* const doc, const bool fillBackground) - : Button (String::empty), + : Button (String()), document (doc), alwaysFillBackground (fillBackground) { diff --git a/extras/Projucer/Source/ComponentEditor/jucer_BinaryResources.cpp b/extras/Projucer/Source/ComponentEditor/jucer_BinaryResources.cpp index 84d19c1ab3..d085e29e02 100644 --- a/extras/Projucer/Source/ComponentEditor/jucer_BinaryResources.cpp +++ b/extras/Projucer/Source/ComponentEditor/jucer_BinaryResources.cpp @@ -158,7 +158,7 @@ String BinaryResources::browseForResource (const String& title, return name; } - return String::empty; + return String(); } String BinaryResources::findUniqueName (const String& rootName) const diff --git a/extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.cpp b/extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.cpp index 95a3517841..77d349caf9 100644 --- a/extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.cpp +++ b/extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.cpp @@ -715,7 +715,7 @@ void ComponentLayout::fillInGeneratedCode (GeneratedCode& code) const String ComponentLayout::getComponentMemberVariableName (Component* comp) const { if (comp == nullptr) - return String::empty; + return String(); String name (comp->getProperties() ["memberName"].toString()); @@ -730,7 +730,7 @@ void ComponentLayout::setComponentMemberVariableName (Component* comp, const Str jassert (comp != nullptr); const String oldName (getComponentMemberVariableName (comp)); - comp->getProperties().set ("memberName", String::empty); + comp->getProperties().set ("memberName", String()); const String n (getUnusedMemberName (CodeHelpers::makeValidIdentifier (newName, false, true, false), comp)); comp->getProperties().set ("memberName", n); @@ -775,7 +775,7 @@ String ComponentLayout::getUnusedMemberName (String nameRoot, Component* comp) c String ComponentLayout::getComponentVirtualClassName (Component* comp) const { if (comp == nullptr) - return String::empty; + return String(); return comp->getProperties() ["virtualName"]; } diff --git a/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp b/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp index d3f95499b2..29767fbec2 100644 --- a/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp +++ b/extras/Projucer/Source/ComponentEditor/jucer_JucerDocument.cpp @@ -173,7 +173,7 @@ void JucerDocument::setParentClasses (const String& classes) s = s.fromFirstOccurrenceOf (" ", false, false); if (s.trim().isEmpty()) - type = s = String::empty; + type = s = String(); } s = type + CodeHelpers::makeValidIdentifier (s.trim(), false, false, true); @@ -378,11 +378,11 @@ bool JucerDocument::loadFromXml (const XmlElement& xml) && getTypeName().equalsIgnoreCase (xml.getStringAttribute ("documentType"))) { className = xml.getStringAttribute ("className", defaultClassName); - templateFile = xml.getStringAttribute ("template", String::empty); - componentName = xml.getStringAttribute ("componentName", String::empty); + templateFile = xml.getStringAttribute ("template", String()); + componentName = xml.getStringAttribute ("componentName", String()); parentClasses = xml.getStringAttribute ("parentClasses", defaultParentClasses); - constructorParams = xml.getStringAttribute ("constructorParams", String::empty); - variableInitialisers = xml.getStringAttribute ("variableInitialisers", String::empty); + constructorParams = xml.getStringAttribute ("constructorParams", String()); + variableInitialisers = xml.getStringAttribute ("variableInitialisers", String()); fixedSize = xml.getBoolAttribute ("fixedSize", false); initialWidth = xml.getIntAttribute ("initialWidth", 300); @@ -425,10 +425,10 @@ void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const code.constructorCode << "setName (" + quotedString (componentName, false) + ");\n"; // call these now, just to make sure they're the first two methods in the list. - code.getCallbackCode (String::empty, "void", "paint (Graphics& g)", false) + code.getCallbackCode (String(), "void", "paint (Graphics& g)", false) << "//[UserPrePaint] Add your own custom painting code here..\n//[/UserPrePaint]\n\n"; - code.getCallbackCode (String::empty, "void", "resized()", false) + code.getCallbackCode (String(), "void", "resized()", false) << "//[UserPreResize] Add your own custom resize code here..\n//[/UserPreResize]\n\n"; if (ComponentLayout* l = getComponentLayout()) @@ -449,10 +449,10 @@ void JucerDocument::fillInGeneratedCode (GeneratedCode& code) const if (initialWidth > 0 || initialHeight > 0) code.constructorCode << "\nsetSize (" << initialWidth << ", " << initialHeight << ");\n"; - code.getCallbackCode (String::empty, "void", "paint (Graphics& g)", false) + code.getCallbackCode (String(), "void", "paint (Graphics& g)", false) << "//[UserPaint] Add your own custom painting code here..\n//[/UserPaint]"; - code.getCallbackCode (String::empty, "void", "resized()", false) + code.getCallbackCode (String(), "void", "resized()", false) << "//[UserResized] Add your own custom resize handling here..\n//[/UserResized]"; // add optional methods @@ -491,7 +491,7 @@ void JucerDocument::fillInPaintCode (GeneratedCode& code) const { for (int i = 0; i < getNumPaintRoutines(); ++i) getPaintRoutine (i) - ->fillInGeneratedCode (code, code.getCallbackCode (String::empty, "void", "paint (Graphics& g)", false)); + ->fillInGeneratedCode (code, code.getCallbackCode (String(), "void", "paint (Graphics& g)", false)); } void JucerDocument::setTemplateFile (const String& newFile) diff --git a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_ColouredElement.cpp b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_ColouredElement.cpp index 6171f8a0e2..0e65f2cd10 100644 --- a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_ColouredElement.cpp +++ b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_ColouredElement.cpp @@ -377,7 +377,7 @@ public: String getResource() const { if (element == nullptr) - return String::empty; + return String(); if (isForStroke) return element->getStrokeType().fill.imageResourceName; @@ -893,12 +893,12 @@ void ColouredElement::addColourAttributes (XmlElement* const e) const bool ColouredElement::loadColourAttributes (const XmlElement& xml) { - fillType.restoreFromString (xml.getStringAttribute ("fill", String::empty)); + fillType.restoreFromString (xml.getStringAttribute ("fill", String())); isStrokePresent = showOutline && xml.getBoolAttribute ("hasStroke", false); - strokeType.restoreFromString (xml.getStringAttribute ("stroke", String::empty)); - strokeType.fill.restoreFromString (xml.getStringAttribute ("strokeColour", String::empty)); + strokeType.restoreFromString (xml.getStringAttribute ("stroke", String())); + strokeType.fill.restoreFromString (xml.getStringAttribute ("strokeColour", String())); return true; } diff --git a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_FillType.h b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_FillType.h index 9d8e75e49f..1db4560512 100644 --- a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_FillType.h +++ b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_FillType.h @@ -202,7 +202,7 @@ public: break; } - return String::empty; + return String(); } void restoreFromString (const String& s) diff --git a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_ImageResourceProperty.h b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_ImageResourceProperty.h index 23e2fe08a4..40203105f4 100644 --- a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_ImageResourceProperty.h +++ b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_ImageResourceProperty.h @@ -77,8 +77,8 @@ public: String resource (document.getResources() .browseForResource ("Select an image file to add as a resource", "*.jpg;*.jpeg;*.png;*.gif;*.svg", - File::nonexistent, - String::empty)); + File(), + String())); if (resource.isNotEmpty()) setResource (resource); @@ -86,7 +86,7 @@ public: else { if (choices[newIndex] == getNoneText() && allowChoiceOfNoResource) - setResource (String::empty); + setResource (String()); else setResource (choices [newIndex]); } @@ -110,7 +110,7 @@ public: choices.clear(); choices.add ("-- create a new image resource -- "); - choices.add (String::empty); + choices.add (String()); if (allowChoiceOfNoResource) choices.add (getNoneText()); diff --git a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_PaintElementImage.h b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_PaintElementImage.h index ac7a9b98eb..1f6240aa4b 100644 --- a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_PaintElementImage.h +++ b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_PaintElementImage.h @@ -368,7 +368,7 @@ public: if (xml.hasTagName (getTagName())) { position.restoreFromXml (xml, position); - resourceName = xml.getStringAttribute ("resource", String::empty); + resourceName = xml.getStringAttribute ("resource", String()); opacity = xml.getDoubleAttribute ("opacity", 1.0); mode = (StretchMode) xml.getIntAttribute ("mode", (int) stretched); @@ -405,7 +405,7 @@ private: if (element != nullptr) return element->getResource(); - return String::empty; + return String(); } }; diff --git a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_PaintElementPath.cpp b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_PaintElementPath.cpp index 75d08f1576..69fa3a317e 100644 --- a/extras/Projucer/Source/ComponentEditor/paintelements/jucer_PaintElementPath.cpp +++ b/extras/Projucer/Source/ComponentEditor/paintelements/jucer_PaintElementPath.cpp @@ -425,7 +425,7 @@ void PaintElementPath::fillInGeneratedCode (GeneratedCode& code, String& paintMe r << '\n'; if (somePointsAreRelative) - code.getCallbackCode (String::empty, "void", "resized()", false) + code.getCallbackCode (String(), "void", "resized()", false) << pathVariable << ".clear();\n" << r; else code.constructorCode << r; diff --git a/extras/Projucer/Source/ComponentEditor/properties/jucer_FilePropertyComponent.h b/extras/Projucer/Source/ComponentEditor/properties/jucer_FilePropertyComponent.h index 902e924447..7a4d867e00 100644 --- a/extras/Projucer/Source/ComponentEditor/properties/jucer_FilePropertyComponent.h +++ b/extras/Projucer/Source/ComponentEditor/properties/jucer_FilePropertyComponent.h @@ -35,9 +35,9 @@ public: const bool allowEditingOfFilename, const String& fileBrowserWildcard = "*") : PropertyComponent (name), - filenameComp (name, File::nonexistent, allowEditingOfFilename, + filenameComp (name, File(), allowEditingOfFilename, isDirectory, false, fileBrowserWildcard, - String::empty, String::empty) + String(), String()) { addAndMakeVisible (filenameComp); filenameComp.addListener (this); diff --git a/extras/Projucer/Source/ComponentEditor/properties/jucer_FontPropertyComponent.h b/extras/Projucer/Source/ComponentEditor/properties/jucer_FontPropertyComponent.h index 27fdda7664..43519c4fbc 100644 --- a/extras/Projucer/Source/ComponentEditor/properties/jucer_FontPropertyComponent.h +++ b/extras/Projucer/Source/ComponentEditor/properties/jucer_FontPropertyComponent.h @@ -36,7 +36,7 @@ public: choices.add (getDefaultSans()); choices.add (getDefaultSerif()); choices.add (getDefaultMono()); - choices.add (String::empty); + choices.add (String()); static StringArray fontNames; @@ -90,7 +90,7 @@ public: static String getTypefaceNameCode (const String& typefaceName) { - if (typefaceName == getDefaultFont()) return String::empty; + if (typefaceName == getDefaultFont()) return String(); if (typefaceName == getDefaultSans()) return "Font::getDefaultSansSerifFontName(), "; if (typefaceName == getDefaultSerif()) return "Font::getDefaultSerifFontName(), "; if (typefaceName == getDefaultMono()) return "Font::getDefaultMonospacedFontName(), "; diff --git a/extras/Projucer/Source/ComponentEditor/properties/jucer_PositionPropertyBase.h b/extras/Projucer/Source/ComponentEditor/properties/jucer_PositionPropertyBase.h index c02dad83ed..9051c3146b 100644 --- a/extras/Projucer/Source/ComponentEditor/properties/jucer_PositionPropertyBase.h +++ b/extras/Projucer/Source/ComponentEditor/properties/jucer_PositionPropertyBase.h @@ -414,7 +414,7 @@ protected: public: PositionPropLabel (PositionPropertyBase& owner_) - : Label (String::empty, String::empty), + : Label (String(), String()), owner (owner_) { setEditable (true, true, false); diff --git a/extras/Projucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp b/extras/Projucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp index c4753bd34a..5b175d085f 100644 --- a/extras/Projucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp +++ b/extras/Projucer/Source/ComponentEditor/ui/jucer_JucerDocumentEditor.cpp @@ -47,7 +47,7 @@ public: : PropertyComponent ("extra callbacks", 250), document (doc) { - addAndMakeVisible (listBox = new ListBox (String::empty, this)); + addAndMakeVisible (listBox = new ListBox (String(), this)); listBox->setRowHeight (22); document.addChangeListener (this); @@ -817,20 +817,20 @@ void JucerDocumentEditor::getCommandInfo (const CommandID commandID, Application break; case StandardApplicationCommandIDs::cut: - result.setInfo (TRANS ("Cut"), String::empty, "Editing", 0); + result.setInfo (TRANS ("Cut"), String(), "Editing", 0); result.setActive (isSomethingSelected()); result.defaultKeypresses.add (KeyPress ('x', cmd, 0)); break; case StandardApplicationCommandIDs::copy: - result.setInfo (TRANS ("Copy"), String::empty, "Editing", 0); + result.setInfo (TRANS ("Copy"), String(), "Editing", 0); result.setActive (isSomethingSelected()); result.defaultKeypresses.add (KeyPress ('c', cmd, 0)); break; case StandardApplicationCommandIDs::paste: { - result.setInfo (TRANS ("Paste"), String::empty, "Editing", 0); + result.setInfo (TRANS ("Paste"), String(), "Editing", 0); result.defaultKeypresses.add (KeyPress ('v', cmd, 0)); bool canPaste = false; @@ -851,18 +851,18 @@ void JucerDocumentEditor::getCommandInfo (const CommandID commandID, Application break; case StandardApplicationCommandIDs::del: - result.setInfo (TRANS ("Delete"), String::empty, "Editing", 0); + result.setInfo (TRANS ("Delete"), String(), "Editing", 0); result.setActive (isSomethingSelected()); break; case StandardApplicationCommandIDs::selectAll: - result.setInfo (TRANS ("Select All"), String::empty, "Editing", 0); + result.setInfo (TRANS ("Select All"), String(), "Editing", 0); result.setActive (currentPaintRoutine != nullptr || currentLayout != nullptr); result.defaultKeypresses.add (KeyPress ('a', cmd, 0)); break; case StandardApplicationCommandIDs::deselectAll: - result.setInfo (TRANS ("Deselect All"), String::empty, "Editing", 0); + result.setInfo (TRANS ("Deselect All"), String(), "Editing", 0); result.setActive (currentPaintRoutine != nullptr || currentLayout != nullptr); result.defaultKeypresses.add (KeyPress ('d', cmd, 0)); break; diff --git a/extras/Projucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp b/extras/Projucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp index 897c134e6d..e7e813c710 100644 --- a/extras/Projucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp +++ b/extras/Projucer/Source/ComponentEditor/ui/jucer_ResourceEditorPanel.cpp @@ -84,7 +84,7 @@ ResourceEditorPanel::ResourceEditorPanel (JucerDocument& doc) delButton.addListener (this); delButton.setEnabled (false); - addAndMakeVisible (listBox = new TableListBox (String::empty, this)); + addAndMakeVisible (listBox = new TableListBox (String(), this)); listBox->getHeader().addColumn ("name", 1, 150, 80, 400); listBox->getHeader().addColumn ("original file", 2, 350, 80, 800); listBox->getHeader().addColumn ("size", 3, 100, 40, 150); @@ -247,8 +247,8 @@ void ResourceEditorPanel::buttonClicked (Button* b) document.getResources() .browseForResource ("Select a file to add as a resource", "*", - File::nonexistent, - String::empty); + File(), + String()); } else if (b == &delButton) { diff --git a/extras/Projucer/Source/LiveBuildEngine/projucer_ClassDatabase.h b/extras/Projucer/Source/LiveBuildEngine/projucer_ClassDatabase.h index 906f69f78c..f68d4391be 100644 --- a/extras/Projucer/Source/LiveBuildEngine/projucer_ClassDatabase.h +++ b/extras/Projucer/Source/LiveBuildEngine/projucer_ClassDatabase.h @@ -219,7 +219,7 @@ struct ClassDatabase if (isAbstract) return "This class is abstract"; if (noDefaultConstructor) return "This class has no default constructor"; if (inAnonymousNamespace) return "This class is declared inside an anonymous namespace"; - return String::empty; + return String(); } bool isDisallowed (const InstantiationFlags& disallowedFlags) const diff --git a/extras/Projucer/Source/LiveBuildEngine/projucer_ComponentListComp.h b/extras/Projucer/Source/LiveBuildEngine/projucer_ComponentListComp.h index e18a990f69..5dae23b1cb 100644 --- a/extras/Projucer/Source/LiveBuildEngine/projucer_ComponentListComp.h +++ b/extras/Projucer/Source/LiveBuildEngine/projucer_ComponentListComp.h @@ -82,7 +82,7 @@ private: } String getRenamingName() const override { return getDisplayName(); } - String getDisplayName() const override { return (namespaceToShow != nullptr ? namespaceToShow->name : String::empty) + "::"; } + String getDisplayName() const override { return (namespaceToShow != nullptr ? namespaceToShow->name : String()) + "::"; } void setName (const String&) override {} bool isMissing() override { return false; } Icon getIcon() const override { return Icon (getIcons().graph, getContrastingColour (Colours::darkred, 0.5f)); } diff --git a/extras/Projucer/Source/LiveBuildEngine/projucer_CppHelpers.h b/extras/Projucer/Source/LiveBuildEngine/projucer_CppHelpers.h index 829a7b659f..bb2f2ac579 100644 --- a/extras/Projucer/Source/LiveBuildEngine/projucer_CppHelpers.h +++ b/extras/Projucer/Source/LiveBuildEngine/projucer_CppHelpers.h @@ -190,7 +190,7 @@ struct CppParserHelpers if (CPlusPlusCodeTokeniser::isReservedKeyword (ed.getText().replaceSection (ed.getHighlightedRegion().getStart(), ed.getHighlightedRegion().getLength(), s))) - return String::empty; + return String(); return s; } diff --git a/extras/Projucer/Source/LiveBuildEngine/projucer_ErrorListComponent.h b/extras/Projucer/Source/LiveBuildEngine/projucer_ErrorListComponent.h index 61181f926e..543e11ad1f 100644 --- a/extras/Projucer/Source/LiveBuildEngine/projucer_ErrorListComponent.h +++ b/extras/Projucer/Source/LiveBuildEngine/projucer_ErrorListComponent.h @@ -27,7 +27,7 @@ class ErrorListComp : public TreePanelBase, { public: ErrorListComp (ErrorList& el) - : TreePanelBase (nullptr, String::empty), + : TreePanelBase (nullptr, String()), errorList (el) { setName ("Errors and Warnings"); diff --git a/extras/Projucer/Source/LiveBuildEngine/projucer_SourceCodeRange.h b/extras/Projucer/Source/LiveBuildEngine/projucer_SourceCodeRange.h index a6b0b5b9e3..1db9fdd24b 100644 --- a/extras/Projucer/Source/LiveBuildEngine/projucer_SourceCodeRange.h +++ b/extras/Projucer/Source/LiveBuildEngine/projucer_SourceCodeRange.h @@ -82,7 +82,7 @@ struct SourceCodeRange String toString() const { if (file.isEmpty() && range.isEmpty()) - return String::empty; + return String(); return file + ":" + String (range.getStart()) + ":" + String (range.getEnd()); } diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_AndroidStudio.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_AndroidStudio.h index 0ff93cb092..4b873964c6 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_AndroidStudio.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_AndroidStudio.h @@ -179,7 +179,7 @@ public: return defaultInstallation; #endif - return File::nonexistent; + return File(); } protected: diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h index 59a268ce6d..199bff2955 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h @@ -188,7 +188,7 @@ private: if (isCodeBlocks() && isWindows()) { defines.set ("__MINGW__", "1"); - defines.set ("__MINGW_EXTENSION", String::empty); + defines.set ("__MINGW_EXTENSION", String()); } else { diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h index 6f6fa0f6a7..bc58f2521e 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h @@ -767,7 +767,7 @@ protected: << newLine << "#endif" << newLine; - if (iconFile != File::nonexistent) + if (iconFile != File()) mo << newLine << "IDI_ICON1 ICON DISCARDABLE " << iconFile.getFileName().quoted() << newLine @@ -862,7 +862,7 @@ public: if (group.getID() == ProjectSaver::getGeneratedGroupID()) { - if (iconFile != File::nonexistent) + if (iconFile != File()) { group.addFileAtIndex (iconFile, -1, true); group.findItemForFile (iconFile).getShouldAddToBinaryResourcesValue() = false; @@ -884,7 +884,7 @@ public: { MemoryOutputStream mo; - writeSolutionFile (mo, getSolutionVersionString(), String::empty, getVCProjFile()); + writeSolutionFile (mo, getSolutionVersionString(), String(), getVCProjFile()); overwriteFileIfDifferentOrThrow (getSLNFile(), mo); } @@ -1493,7 +1493,7 @@ protected: { XmlElement* targetName = props->createNewChildElement ("TargetName"); setConditionAttribute (*targetName, config); - targetName->addTextElement (config.getOutputFilename (String::empty, true)); + targetName->addTextElement (config.getOutputFilename (String(), true)); } { @@ -1660,7 +1660,7 @@ protected: } } - if (iconFile != File::nonexistent) + if (iconFile != File()) { XmlElement* e = otherFilesGroup->createNewChildElement ("None"); e->setAttribute ("Include", prependDot (iconFile.getFileName())); @@ -1694,7 +1694,7 @@ protected: if (projectType.isStaticLibrary()) return "StaticLibrary"; jassertfalse; - return String::empty; + return String(); } static const char* getOptimisationLevelString (int level) @@ -1777,7 +1777,7 @@ protected: for (int i = 0; i < projectItem.getNumChildren(); ++i) addFilesToFilter (projectItem.getChild(i), - (path.isEmpty() ? String::empty : (path + "\\")) + projectItem.getChild(i).getName(), + (path.isEmpty() ? String() : (path + "\\")) + projectItem.getChild(i).getName(), cpps, headers, otherFiles, groups); } else if (projectItem.shouldBeAddedToTargetProject()) diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h index 77075906bb..341150f53f 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h @@ -550,7 +550,7 @@ public: xcodeIsExecutable = true; xcodeCreatePList = false; xcodeFileType = "compiled.mach-o.executable"; - xcodeBundleExtension = String::empty; + xcodeBundleExtension = String(); xcodeProductType = "com.apple.product-type.tool"; xcodeCopyToProductInstallPathAfterBuild = false; break; diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp index 7f5f7dd972..c43b44f2de 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp @@ -833,5 +833,5 @@ String ProjectExporter::getExternalLibraryFlags (const BuildConfiguration& confi if (libraries.size() != 0) return replacePreprocessorTokens (config, "-l" + libraries.joinIntoString (" -l")).trim(); - return String::empty; + return String(); } diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h index e542495238..cb7ea20bc8 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h @@ -384,7 +384,7 @@ protected: static void writeXmlOrThrow (const XmlElement& xml, const File& file, const String& encoding, int maxCharsPerLine, bool useUnixNewLines = false) { MemoryOutputStream mo; - xml.writeToStream (mo, String::empty, false, true, encoding, maxCharsPerLine); + xml.writeToStream (mo, String(), false, true, encoding, maxCharsPerLine); if (useUnixNewLines) { diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectSaver.h b/extras/Projucer/Source/Project Saving/jucer_ProjectSaver.h index 4d6f7dd106..ebdb6749fc 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectSaver.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectSaver.h @@ -287,7 +287,7 @@ private: if (xml != nullptr) { MemoryOutputStream mo; - xml->writeToStream (mo, String::empty); + xml->writeToStream (mo, String()); replaceFileIfDifferent (projectFile, mo); } } @@ -324,9 +324,9 @@ private: if (! foundCodeSection) { - userContent.add (String::empty); + userContent.add (String()); userContent.add ("// (You can add your own code in this section, and the Projucer will not overwrite it)"); - userContent.add (String::empty); + userContent.add (String()); } return userContent.joinIntoString (newLine) + newLine; diff --git a/extras/Projucer/Source/Project Saving/jucer_TextWithDefaultPropertyComponent.h b/extras/Projucer/Source/Project Saving/jucer_TextWithDefaultPropertyComponent.h index e881bdaa82..5117a1fb5d 100644 --- a/extras/Projucer/Source/Project Saving/jucer_TextWithDefaultPropertyComponent.h +++ b/extras/Projucer/Source/Project Saving/jucer_TextWithDefaultPropertyComponent.h @@ -36,7 +36,7 @@ class TextWithDefaultPropertyComponent : public PropertyComponent, { public: LabelComp (TextWithDefaultPropertyComponent& tpc, const int charLimit) - : Label (String::empty, String::empty), + : Label (String(), String()), owner (tpc), maxChars (charLimit) { @@ -158,7 +158,7 @@ private: void editorShown (Label*, TextEditor& editor) override { if (cachedValue.isUsingDefault()) - editor.setText (String::empty, dontSendNotification); + editor.setText (String(), dontSendNotification); } void editorHidden (Label*, TextEditor&) override {} diff --git a/extras/Projucer/Source/Project/jucer_DependencyPathPropertyComponent.cpp b/extras/Projucer/Source/Project/jucer_DependencyPathPropertyComponent.cpp index da5cff0514..69d9e3f6b6 100644 --- a/extras/Projucer/Source/Project/jucer_DependencyPathPropertyComponent.cpp +++ b/extras/Projucer/Source/Project/jucer_DependencyPathPropertyComponent.cpp @@ -65,7 +65,7 @@ try : TextPropertyComponent (propertyName, 1024, false), // which has set the project value to whatever is displayed in the label (this may be the // global/fallback value). In this case we have to reset the project value to blank: if (initialValueIsEmpty) - getValue().setValue (String::empty); + getValue().setValue (String()); getValue().addListener (this); setColour (textColourId, getTextColourToDisplay()); @@ -114,7 +114,7 @@ void DependencyPathPropertyComponent::labelTextChanged (Label*) void DependencyPathPropertyComponent::editorShown (Label* /*label*/, TextEditor& editor) { if (! pathValueSource.isUsingProjectSettings()) - editor.setText (String::empty, dontSendNotification); + editor.setText (String(), dontSendNotification); } void DependencyPathPropertyComponent::editorHidden (Label*, TextEditor&) diff --git a/extras/Projucer/Source/Project/jucer_DependencyPathPropertyComponent.h b/extras/Projucer/Source/Project/jucer_DependencyPathPropertyComponent.h index 64d7225dca..36dd1f599f 100644 --- a/extras/Projucer/Source/Project/jucer_DependencyPathPropertyComponent.h +++ b/extras/Projucer/Source/Project/jucer_DependencyPathPropertyComponent.h @@ -90,7 +90,7 @@ private: if ((value.refersToSameSourceAs (globalSettingsValue) && isUsingGlobalSettings())) { sendChangeMessage (true); - setValue (String::empty); // make sure that the project-specific value is still blank + setValue (String()); // make sure that the project-specific value is still blank } } diff --git a/extras/Projucer/Source/Project/jucer_Module.cpp b/extras/Projucer/Source/Project/jucer_Module.cpp index 5ee67e1dbf..307c52db20 100644 --- a/extras/Projucer/Source/Project/jucer_Module.cpp +++ b/extras/Projucer/Source/Project/jucer_Module.cpp @@ -761,7 +761,7 @@ void EnabledModuleList::addModuleFromUserSelectedFile() { static File lastLocation (findDefaultModulesFolder (project)); - FileChooser fc ("Select a module to add...", lastLocation, String::empty, false); + FileChooser fc ("Select a module to add...", lastLocation, String(), false); if (fc.browseForDirectory()) { diff --git a/extras/Projucer/Source/Project/jucer_Project.cpp b/extras/Projucer/Source/Project/jucer_Project.cpp index 686007bce7..9ad61e4a19 100644 --- a/extras/Projucer/Source/Project/jucer_Project.cpp +++ b/extras/Projucer/Source/Project/jucer_Project.cpp @@ -1231,15 +1231,13 @@ void Project::createExporterForCurrentPlatform() String Project::getFileTemplate (const String& templateName) { int dataSize; - const char* data = BinaryData::getNamedResource (templateName.toUTF8(), dataSize); - if (data == nullptr) - { - jassertfalse; - return String::empty; - } + if (const char* data = BinaryData::getNamedResource (templateName.toUTF8(), dataSize)) + return String::fromUTF8 (data, dataSize); + + jassertfalse; + return String(); - return String::fromUTF8 (data, dataSize); } //============================================================================== diff --git a/extras/Projucer/Source/Project/jucer_ProjectContentComponent.cpp b/extras/Projucer/Source/Project/jucer_ProjectContentComponent.cpp index 42f9d449fc..ab3a4c8d0b 100644 --- a/extras/Projucer/Source/Project/jucer_ProjectContentComponent.cpp +++ b/extras/Projucer/Source/Project/jucer_ProjectContentComponent.cpp @@ -637,7 +637,7 @@ bool ProjectContentComponent::hasFileInRecentList (const File& f) const File ProjectContentComponent::getCurrentFile() const { return currentDocument != nullptr ? currentDocument->getFile() - : File::nonexistent; + : File(); } bool ProjectContentComponent::showDocument (OpenDocumentManager::Document* doc, bool grabFocus) @@ -1174,7 +1174,7 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica break; case CommandIDs::deleteSelectedItem: - result.setInfo ("Delete Selected File", String::empty, CommandCategories::general, 0); + result.setInfo ("Delete Selected File", String(), CommandCategories::general, 0); result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0)); result.defaultKeypresses.add (KeyPress (KeyPress::backspaceKey, 0, 0)); result.setActive (dynamic_cast (treeViewTabs.getCurrentContentComponent()) != nullptr); diff --git a/extras/Projucer/Source/Project/jucer_ProjectTree_Base.h b/extras/Projucer/Source/Project/jucer_ProjectTree_Base.h index 3bddcb4514..1ae766516f 100644 --- a/extras/Projucer/Source/Project/jucer_ProjectTree_Base.h +++ b/extras/Projucer/Source/Project/jucer_ProjectTree_Base.h @@ -140,7 +140,7 @@ public: virtual void browseToAddExistingFiles() { const File location (item.isGroup() ? item.determineGroupFolder() : getFile()); - FileChooser fc ("Add Files to Jucer Project", location, String::empty, false); + FileChooser fc ("Add Files to Jucer Project", location, String(), false); if (fc.browseForMultipleFilesOrDirectories()) { @@ -156,7 +156,7 @@ public: virtual void checkFileStatus() // (recursive) { const File file (getFile()); - const bool nowMissing = file != File::nonexistent && ! file.exists(); + const bool nowMissing = file != File() && ! file.exists(); if (nowMissing != isFileMissing) { @@ -235,7 +235,7 @@ public: bool mightContainSubItems() override { return item.getNumChildren() > 0; } String getUniqueName() const override { jassert (item.getID().isNotEmpty()); return item.getID(); } bool canBeSelected() const override { return true; } - String getTooltip() override { return String::empty; } + String getTooltip() override { return String(); } File getDraggableFile() const override { return getFile(); } var getDragSourceDescription() override diff --git a/extras/Projucer/Source/Utility/jucer_FilePathPropertyComponent.h b/extras/Projucer/Source/Utility/jucer_FilePathPropertyComponent.h index b6e966e167..0c536b7eb8 100644 --- a/extras/Projucer/Source/Utility/jucer_FilePathPropertyComponent.h +++ b/extras/Projucer/Source/Utility/jucer_FilePathPropertyComponent.h @@ -39,7 +39,7 @@ public: const String& propertyDescription, bool isDirectory, const String& wildcards = "*", - const File& rootToUseForRelativePaths = File::nonexistent) + const File& rootToUseForRelativePaths = File()) : PropertyComponent (propertyDescription), innerComp (valueToControl, isDirectory, wildcards, rootToUseForRelativePaths) { @@ -122,8 +122,8 @@ private: void setTo (const File& f) { - value = (root == File::nonexistent) ? f.getFullPathName() - : f.getRelativePathFrom (root); + value = (root == File()) ? f.getFullPathName() + : f.getRelativePathFrom (root); } Value value; diff --git a/extras/Projucer/Source/Utility/jucer_SVGPathDataComponent.h b/extras/Projucer/Source/Utility/jucer_SVGPathDataComponent.h index af29a2c556..7be4607d1f 100644 --- a/extras/Projucer/Source/Utility/jucer_SVGPathDataComponent.h +++ b/extras/Projucer/Source/Utility/jucer_SVGPathDataComponent.h @@ -27,7 +27,7 @@ class SVGPathDataComponent : public Component, { public: SVGPathDataComponent() - : desc (String::empty, + : desc (String(), "Paste an SVG path string into the top box, and it'll be converted to some C++ " "code that will load it as a Path object..") { diff --git a/extras/Projucer/Source/Utility/jucer_TranslationTool.h b/extras/Projucer/Source/Utility/jucer_TranslationTool.h index 2fa6f927b4..cf37e6ed1c 100644 --- a/extras/Projucer/Source/Utility/jucer_TranslationTool.h +++ b/extras/Projucer/Source/Utility/jucer_TranslationTool.h @@ -201,7 +201,7 @@ struct TranslationHelpers if (currentItem.isNotEmpty()) result.add (currentItem); - currentItem = String::empty; + currentItem = String(); } else { @@ -273,7 +273,7 @@ struct TranslationHelpers { lines.add ("language: " + original.getLanguageName()); lines.add ("countries: " + original.getCountryCodes().joinIntoString (" ")); - lines.add (String::empty); + lines.add (String()); const StringArray& originalKeys (originalStrings.getAllKeys()); const StringArray& originalValues (originalStrings.getAllValues()); @@ -296,7 +296,7 @@ struct TranslationHelpers { lines.add ("language: [enter full name of the language here!]"); lines.add ("countries: [enter list of 2-character country codes here!]"); - lines.add (String::empty); + lines.add (String()); } for (int i = 0; i < preStrings.size(); ++i) @@ -429,8 +429,7 @@ private: void loadFile() { FileChooser fc ("Choose a translation file to load", - File::nonexistent, - "*"); + File(), "*"); if (fc.browseForFileToOpen()) { diff --git a/extras/Projucer/Source/Utility/jucer_UTF8Component.h b/extras/Projucer/Source/Utility/jucer_UTF8Component.h index 23a363c07a..bc8edf59a5 100644 --- a/extras/Projucer/Source/Utility/jucer_UTF8Component.h +++ b/extras/Projucer/Source/Utility/jucer_UTF8Component.h @@ -27,7 +27,7 @@ class UTF8Component : public Component, { public: UTF8Component() - : desc (String::empty, + : desc (String(), "Type any string into the box, and it'll be shown below as a portable UTF-8 literal, " "ready to cut-and-paste into your source-code...") { diff --git a/extras/Projucer/Source/Wizards/jucer_NewFileWizard.cpp b/extras/Projucer/Source/Wizards/jucer_NewFileWizard.cpp index 0946db02f6..b00791115d 100644 --- a/extras/Projucer/Source/Wizards/jucer_NewFileWizard.cpp +++ b/extras/Projucer/Source/Wizards/jucer_NewFileWizard.cpp @@ -142,7 +142,7 @@ public: TRANS ("Please enter the name for the new class"), AlertWindow::NoIcon, nullptr); - aw.addTextEditor (getClassNameFieldName(), String::empty, String::empty, false); + aw.addTextEditor (getClassNameFieldName(), String(), String(), false); aw.addButton (TRANS ("Create Files"), 1, KeyPress (KeyPress::returnKey)); aw.addButton (TRANS ("Cancel"), 0, KeyPress (KeyPress::escapeKey)); diff --git a/extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h b/extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h index 6656c051f2..56204c40a7 100644 --- a/extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h +++ b/extras/Projucer/Source/Wizards/jucer_NewProjectWizard.h @@ -38,7 +38,7 @@ static ComboBox& createFileCreationOptionComboBox (Component& setupComp, c->addItemList (fileOptions, 1); c->setSelectedId (1, dontSendNotification); - Label* l = new Label (String::empty, TRANS("Files to Auto-Generate") + ":"); + Label* l = new Label (String(), TRANS("Files to Auto-Generate") + ":"); l->attachToComponent (c, true); itemsCreated.add (l); diff --git a/extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h b/extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h index 98797ed81f..db454bb8a7 100644 --- a/extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h +++ b/extras/Projucer/Source/Wizards/jucer_NewProjectWizardComponent.h @@ -34,9 +34,9 @@ public: ModulesFolderPathBox (File initialFileOrDirectory) : currentPathBox ("currentPathBox"), openFolderButton (TRANS("...")), - modulesLabel (String::empty, TRANS("Modules Folder") + ":") + modulesLabel (String(), TRANS("Modules Folder") + ":") { - if (initialFileOrDirectory == File::nonexistent) + if (initialFileOrDirectory == File()) initialFileOrDirectory = findDefaultModulesFolder(); setModulesFolder (initialFileOrDirectory); @@ -263,14 +263,14 @@ public: WizardComp() : platformTargets(), projectName (TRANS("Project name")), - nameLabel (String::empty, TRANS("Project Name") + ":"), - typeLabel (String::empty, TRANS("Project Type") + ":"), + nameLabel (String(), TRANS("Project Name") + ":"), + typeLabel (String(), TRANS("Project Type") + ":"), fileBrowser (FileBrowserComponent::saveMode | FileBrowserComponent::canSelectDirectories | FileBrowserComponent::doNotClearFileNameOnRootChange, NewProjectWizardClasses::getLastWizardFolder(), nullptr, nullptr), - fileOutline (String::empty, TRANS("Project Folder") + ":"), - targetsOutline (String::empty, TRANS("Target Platforms") + ":"), + fileOutline (String(), TRANS("Project Folder") + ":"), + targetsOutline (String(), TRANS("Target Platforms") + ":"), createButton (TRANS("Create") + "..."), cancelButton (TRANS("Cancel")), modulesPathBox (findDefaultModulesFolder()) diff --git a/extras/Projucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h b/extras/Projucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h index 13413d8b30..dff337dd49 100644 --- a/extras/Projucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h +++ b/extras/Projucer/Source/Wizards/jucer_TemplateThumbnailsComponent.h @@ -254,7 +254,7 @@ public: appFolder = appFolder.getParentDirectory(); } - return File::nonexistent; + return File(); } private: diff --git a/modules/juce_audio_devices/native/juce_mac_AudioCDBurner.mm b/modules/juce_audio_devices/native/juce_mac_AudioCDBurner.mm index 3489a80404..84b25404df 100644 --- a/modules/juce_audio_devices/native/juce_mac_AudioCDBurner.mm +++ b/modules/juce_audio_devices/native/juce_mac_AudioCDBurner.mm @@ -254,7 +254,7 @@ struct OpenDiskDevice [device releaseMediaReservation]; [device releaseExclusiveAccess]; - return String::empty; + return String(); } DRDevice* device; diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index 5ab1d9eb3f..b5b39e44cd 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -129,7 +129,7 @@ public: if (settings != nullptr) f = File (settings->getValue ("lastStateFile")); - if (f == File::nonexistent) + if (f == File()) f = File::getSpecialLocation (File::userDocumentsDirectory); return f; diff --git a/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h b/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h index 9bbfdab889..4f40981bf6 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h +++ b/modules/juce_audio_processors/scanning/juce_PluginDirectoryScanner.h @@ -44,12 +44,11 @@ public: @param formatToLookFor this is the type of format that you want to look for @param directoriesToSearch the path to search @param searchRecursively true to search recursively - @param deadMansPedalFile if this isn't File::nonexistent, then it will - be used as a file to store the names of any plugins - that crash during initialisation. If there are - any plugins listed in it, then these will always - be scanned after all other possible files have - been tried - in this way, even if there's a few + @param deadMansPedalFile if this isn't File(), then it will be used as a file + to store the names of any plugins that crash during + initialisation. If there are any plugins listed in it, + then these will always be scanned after all other possible + files have been tried - in this way, even if there's a few dodgy plugins in your path, then a couple of rescans will still manage to find all the proper plugins. It's probably best to choose a file in the user's diff --git a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp index a321a5da30..790ee1e17b 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp +++ b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp @@ -336,7 +336,7 @@ public: bool allowPluginsWhichRequireAsynchronousInstantiation, int threads, const String& title, const String& text) : owner (plc), formatToScan (format), propertiesToUse (properties), - pathChooserWindow (TRANS("Select folders to scan..."), String::empty, AlertWindow::NoIcon), + pathChooserWindow (TRANS("Select folders to scan..."), String(), AlertWindow::NoIcon), progressWindow (title, text, AlertWindow::NoIcon), progress (0.0), numThreads (threads), allowAsync (allowPluginsWhichRequireAsynchronousInstantiation), finished (false) @@ -422,7 +422,7 @@ private: + TRANS ("Are you sure you want to scan the folder \"XYZ\"?") .replace ("XYZ", f.getFullPathName()), TRANS ("Scan"), - String::empty, + String(), nullptr, ModalCallbackFunction::create (warnAboutStupidPathsCallback, this)); return; diff --git a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp index 3cd8942003..3c2615cd7d 100644 --- a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp @@ -76,7 +76,7 @@ class AudioDeviceSelectorComponent::MidiInputSelectorComponentListBox : public { public: MidiInputSelectorComponentListBox (AudioDeviceManager& dm, const String& noItems) - : ListBox (String::empty, nullptr), + : ListBox (String(), nullptr), deviceManager (dm), noItemsMessage (noItems) { @@ -340,11 +340,11 @@ public: || comboBoxThatHasChanged == inputDeviceDropDown) { if (outputDeviceDropDown != nullptr) - config.outputDeviceName = outputDeviceDropDown->getSelectedId() < 0 ? String::empty + config.outputDeviceName = outputDeviceDropDown->getSelectedId() < 0 ? String() : outputDeviceDropDown->getText(); if (inputDeviceDropDown != nullptr) - config.inputDeviceName = inputDeviceDropDown->getSelectedId() < 0 ? String::empty + config.inputDeviceName = inputDeviceDropDown->getSelectedId() < 0 ? String() : inputDeviceDropDown->getText(); if (! type.hasSeparateInputsAndOutputs()) @@ -390,7 +390,7 @@ public: { if (AudioIODevice* const device = setup.manager->getCurrentAudioDevice()) { - Component modalWindow (String::empty); + Component modalWindow; modalWindow.setOpaque (true); modalWindow.addToDesktop (0); modalWindow.enterModalState(); @@ -445,7 +445,7 @@ public: addAndMakeVisible (outputChanList = new ChannelSelectorListBox (setup, ChannelSelectorListBox::audioOutputType, TRANS ("(no audio output channels found)"))); - outputChanLabel = new Label (String::empty, TRANS("Active output channels:")); + outputChanLabel = new Label (String(), TRANS("Active output channels:")); outputChanLabel->setJustificationType (Justification::centredRight); outputChanLabel->attachToComponent (outputChanList, true); } @@ -466,7 +466,7 @@ public: addAndMakeVisible (inputChanList = new ChannelSelectorListBox (setup, ChannelSelectorListBox::audioInputType, TRANS("(no audio input channels found)"))); - inputChanLabel = new Label (String::empty, TRANS("Active input channels:")); + inputChanLabel = new Label (String(), TRANS("Active input channels:")); inputChanLabel->setJustificationType (Justification::centredRight); inputChanLabel->attachToComponent (inputChanList, true); } @@ -605,11 +605,11 @@ private: { if (outputDeviceDropDown == nullptr) { - outputDeviceDropDown = new ComboBox (String::empty); + outputDeviceDropDown = new ComboBox (String()); outputDeviceDropDown->addListener (this); addAndMakeVisible (outputDeviceDropDown); - outputDeviceLabel = new Label (String::empty, + outputDeviceLabel = new Label (String(), type.hasSeparateInputsAndOutputs() ? TRANS("Output:") : TRANS("Device:")); outputDeviceLabel->attachToComponent (outputDeviceDropDown, true); @@ -634,11 +634,11 @@ private: { if (inputDeviceDropDown == nullptr) { - inputDeviceDropDown = new ComboBox (String::empty); + inputDeviceDropDown = new ComboBox (String()); inputDeviceDropDown->addListener (this); addAndMakeVisible (inputDeviceDropDown); - inputDeviceLabel = new Label (String::empty, TRANS("Input:")); + inputDeviceLabel = new Label (String(), TRANS("Input:")); inputDeviceLabel->attachToComponent (inputDeviceDropDown, true); addAndMakeVisible (inputLevelMeter @@ -655,9 +655,9 @@ private: { if (sampleRateDropDown == nullptr) { - addAndMakeVisible (sampleRateDropDown = new ComboBox (String::empty)); + addAndMakeVisible (sampleRateDropDown = new ComboBox (String())); - sampleRateLabel = new Label (String::empty, TRANS("Sample rate:")); + sampleRateLabel = new Label (String(), TRANS("Sample rate:")); sampleRateLabel->attachToComponent (sampleRateDropDown, true); } else @@ -682,9 +682,9 @@ private: { if (bufferSizeDropDown == nullptr) { - addAndMakeVisible (bufferSizeDropDown = new ComboBox (String::empty)); + addAndMakeVisible (bufferSizeDropDown = new ComboBox (String())); - bufferSizeLabel = new Label (String::empty, TRANS("Audio buffer size:")); + bufferSizeLabel = new Label (String(), TRANS("Audio buffer size:")); bufferSizeLabel->attachToComponent (bufferSizeDropDown, true); } else @@ -724,7 +724,7 @@ public: //============================================================================== ChannelSelectorListBox (const AudioDeviceSetupDetails& setupDetails, const BoxType boxType, const String& noItemsText) - : ListBox (String::empty, nullptr), + : ListBox (String(), nullptr), setup (setupDetails), type (boxType), noItemsMessage (noItemsText) { refresh(); @@ -993,7 +993,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& if (types.size() > 1) { - deviceTypeDropDown = new ComboBox (String::empty); + deviceTypeDropDown = new ComboBox (String()); for (int i = 0; i < types.size(); ++i) deviceTypeDropDown->addItem (types.getUnchecked(i)->getTypeName(), i + 1); @@ -1001,7 +1001,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& addAndMakeVisible (deviceTypeDropDown); deviceTypeDropDown->addListener (this); - deviceTypeDropDownLabel = new Label (String::empty, TRANS("Audio device type:")); + deviceTypeDropDownLabel = new Label (String(), TRANS("Audio device type:")); deviceTypeDropDownLabel->setJustificationType (Justification::centredRight); deviceTypeDropDownLabel->attachToComponent (deviceTypeDropDown, true); } @@ -1012,7 +1012,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& = new MidiInputSelectorComponentListBox (deviceManager, "(" + TRANS("No MIDI inputs available") + ")")); - midiInputsLabel = new Label (String::empty, TRANS ("Active MIDI inputs:")); + midiInputsLabel = new Label (String(), TRANS ("Active MIDI inputs:")); midiInputsLabel->setJustificationType (Justification::topRight); midiInputsLabel->attachToComponent (midiInputsList, true); @@ -1032,7 +1032,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& if (showMidiOutputSelector) { - addAndMakeVisible (midiOutputSelector = new ComboBox (String::empty)); + addAndMakeVisible (midiOutputSelector = new ComboBox (String())); midiOutputSelector->addListener (this); midiOutputLabel = new Label ("lm", TRANS("MIDI Output:")); diff --git a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp index 1c1c9d9db2..23016d075f 100644 --- a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp @@ -26,7 +26,7 @@ class MidiKeyboardUpDownButton : public Button { public: MidiKeyboardUpDownButton (MidiKeyboardComponent& comp, const int d) - : Button (String::empty), owner (comp), delta (d) + : Button (String()), owner (comp), delta (d) { } diff --git a/modules/juce_core/containers/juce_NamedValueSet.cpp b/modules/juce_core/containers/juce_NamedValueSet.cpp index 64b1778729..68afddde8d 100644 --- a/modules/juce_core/containers/juce_NamedValueSet.cpp +++ b/modules/juce_core/containers/juce_NamedValueSet.cpp @@ -85,12 +85,22 @@ bool NamedValueSet::isEmpty() const noexcept return values.isEmpty(); } +static const var& getNullVarRef() noexcept +{ + #if JUCE_ALLOW_STATIC_NULL_VARIABLES + return var::null; + #else + static var nullVar; + return nullVar; + #endif +} + const var& NamedValueSet::operator[] (const Identifier& name) const noexcept { if (const var* v = getVarPointer (name)) return *v; - return var::null; + return getNullVarRef(); } var NamedValueSet::getWithDefault (const Identifier& name, const var& defaultReturnValue) const @@ -189,7 +199,7 @@ const var& NamedValueSet::getValueAt (const int index) const noexcept return values.getReference (index).value; jassertfalse; - return var::null; + return getNullVarRef(); } var* NamedValueSet::getVarPointerAt (int index) const noexcept diff --git a/modules/juce_core/containers/juce_Variant.cpp b/modules/juce_core/containers/juce_Variant.cpp index 01c65edf18..52a8e81afd 100644 --- a/modules/juce_core/containers/juce_Variant.cpp +++ b/modules/juce_core/containers/juce_Variant.cpp @@ -434,7 +434,9 @@ var::var() noexcept : type (&VariantType_Void::instance) {} var::var (const VariantType& t) noexcept : type (&t) {} var::~var() noexcept { type->cleanUp (value); } +#if JUCE_ALLOW_STATIC_NULL_VARIABLES const var var::null; +#endif //============================================================================== var::var (const var& valueToCopy) : type (valueToCopy.type) @@ -582,7 +584,7 @@ const var& var::operator[] (const Identifier& propertyName) const if (DynamicObject* const o = getDynamicObject()) return o->getProperty (propertyName); - return var::null; + return getNullVarRef(); } const var& var::operator[] (const char* const propertyName) const diff --git a/modules/juce_core/containers/juce_Variant.h b/modules/juce_core/containers/juce_Variant.h index 4b57c6a355..f5c77cb644 100644 --- a/modules/juce_core/containers/juce_Variant.h +++ b/modules/juce_core/containers/juce_Variant.h @@ -70,8 +70,10 @@ public: /** Destructor. */ ~var() noexcept; + #if JUCE_ALLOW_STATIC_NULL_VARIABLES /** A static var object that can be used where you need an empty variant object. */ static const var null; + #endif var (const var& valueToCopy); var (int value) noexcept; diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index 8f97cff737..e2a23beb95 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -68,7 +68,9 @@ File& File::operator= (File&& other) noexcept } #endif +#if JUCE_ALLOW_STATIC_NULL_VARIABLES const File File::nonexistent; +#endif //============================================================================== static String removeEllipsis (const String& path) @@ -1009,9 +1011,9 @@ public: const File home (File::getSpecialLocation (File::userHomeDirectory)); const File temp (File::getSpecialLocation (File::tempDirectory)); - expect (! File::nonexistent.exists()); - expect (! File::nonexistent.existsAsFile()); - expect (! File::nonexistent.isDirectory()); + expect (! File().exists()); + expect (! File().existsAsFile()); + expect (! File().isDirectory()); #if ! JUCE_WINDOWS expect (File("/").isDirectory()); #endif diff --git a/modules/juce_core/files/juce_File.h b/modules/juce_core/files/juce_File.h index ad15137790..dbe01c5a97 100644 --- a/modules/juce_core/files/juce_File.h +++ b/modules/juce_core/files/juce_File.h @@ -49,8 +49,7 @@ public: /** Creates an (invalid) file object. The file is initially set to an empty path, so getFullPathName() will return - an empty string, and comparing the file to File::nonexistent will return - true. + an empty string. You can use its operator= method to point it at a proper file. */ @@ -95,8 +94,13 @@ public: #endif //============================================================================== - /** This static constant is used for referring to an 'invalid' file. */ + #if JUCE_ALLOW_STATIC_NULL_VARIABLES + /** This static constant is used for referring to an 'invalid' file. + Bear in mind that you should avoid this kind of static variable, and always prefer + to use File() or {} if you need a default-constructed File object. + */ static const File nonexistent; + #endif //============================================================================== /** Checks whether the file actually exists. diff --git a/modules/juce_core/javascript/juce_JSON.cpp b/modules/juce_core/javascript/juce_JSON.cpp index 455412c417..4a4e134457 100644 --- a/modules/juce_core/javascript/juce_JSON.cpp +++ b/modules/juce_core/javascript/juce_JSON.cpp @@ -625,7 +625,7 @@ public: beginTest ("JSON"); Random r = getRandom(); - expect (JSON::parse (String::empty) == var()); + expect (JSON::parse (String()) == var()); expect (JSON::parse ("{}").isObject()); expect (JSON::parse ("[]").isArray()); expect (JSON::parse ("[ 1234 ]")[0].isInt()); diff --git a/modules/juce_core/juce_core.h b/modules/juce_core/juce_core.h index 39469a0deb..a1fc52225f 100644 --- a/modules/juce_core/juce_core.h +++ b/modules/juce_core/juce_core.h @@ -156,6 +156,16 @@ //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 #endif +/* Config: JUCE_ALLOW_STATIC_NULL_VARIABLES + If disabled, this will turn off dangerous static globals like String::empty, var::null, etc + which can cause nasty order-of-initialisation problems if they are referenced during static + constructor code. +*/ +#ifndef JUCE_ALLOW_STATIC_NULL_VARIABLES + #define JUCE_ALLOW_STATIC_NULL_VARIABLES 1 +#endif + + #ifndef JUCE_STRING_UTF_TYPE #define JUCE_STRING_UTF_TYPE 8 #endif diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 13975ed50e..b025dde5e0 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -237,7 +237,9 @@ private: } }; +#if JUCE_ALLOW_STATIC_NULL_VARIABLES const String String::empty; +#endif //============================================================================== String::String() noexcept : text (&(emptyString.text)) @@ -2270,7 +2272,7 @@ public: beginTest ("Basics"); expect (String().length() == 0); - expect (String() == String::empty); + expect (String() == String()); String s1, s2 ("abcd"); expect (s1.isEmpty() && ! s1.isNotEmpty()); expect (s2.isNotEmpty() && ! s2.isEmpty()); @@ -2282,16 +2284,16 @@ public: expect (String ("abcdefg", 4) == L"abcd"); expect (String ("abcdefg", 4) == String (L"abcdefg", 4)); expect (String::charToString ('x') == "x"); - expect (String::charToString (0) == String::empty); + expect (String::charToString (0) == String()); expect (s2 + "e" == "abcde" && s2 + 'e' == "abcde"); expect (s2 + L'e' == "abcde" && s2 + L"e" == "abcde"); expect (s1.equalsIgnoreCase ("abcD") && s1 < "abce" && s1 > "abbb"); expect (s1.startsWith ("ab") && s1.startsWith ("abcd") && ! s1.startsWith ("abcde")); expect (s1.startsWithIgnoreCase ("aB") && s1.endsWithIgnoreCase ("CD")); expect (s1.endsWith ("bcd") && ! s1.endsWith ("aabcd")); - expectEquals (s1.indexOf (String::empty), 0); - expectEquals (s1.indexOfIgnoreCase (String::empty), 0); - expect (s1.startsWith (String::empty) && s1.endsWith (String::empty) && s1.contains (String::empty)); + expectEquals (s1.indexOf (String()), 0); + expectEquals (s1.indexOfIgnoreCase (String()), 0); + expect (s1.startsWith (String()) && s1.endsWith (String()) && s1.contains (String())); expect (s1.contains ("cd") && s1.contains ("ab") && s1.contains ("abcd")); expect (s1.containsChar ('a')); expect (! s1.containsChar ('x')); @@ -2472,9 +2474,9 @@ public: } beginTest ("Numeric conversions"); - expect (String::empty.getIntValue() == 0); - expect (String::empty.getDoubleValue() == 0.0); - expect (String::empty.getFloatValue() == 0.0f); + expect (String().getIntValue() == 0); + expect (String().getDoubleValue() == 0.0); + expect (String().getFloatValue() == 0.0f); expect (s.getIntValue() == 12345678); expect (s.getLargeIntValue() == (int64) 12345678); expect (s.getDoubleValue() == 12345678.0); @@ -2511,11 +2513,11 @@ public: expect (s3.containsAnyOf (String (L"zzzFs"))); expect (s3.startsWith ("abcd")); expect (s3.startsWithIgnoreCase (String (L"abCD"))); - expect (s3.startsWith (String::empty)); + expect (s3.startsWith (String())); expect (s3.startsWithChar ('a')); expect (s3.endsWith (String ("HIJ"))); expect (s3.endsWithIgnoreCase (String (L"Hij"))); - expect (s3.endsWith (String::empty)); + expect (s3.endsWith (String())); expect (s3.endsWithChar (L'J')); expect (s3.indexOf ("HIJ") == 7); expect (s3.indexOf (String (L"HIJK")) == -1); @@ -2565,28 +2567,28 @@ public: expect (! String ("xx?y").matchesWildcard ("xx?y?", true)); expect (String ("xx?y").matchesWildcard ("xx??", true)); - expectEquals (s5.fromFirstOccurrenceOf (String::empty, true, false), s5); + expectEquals (s5.fromFirstOccurrenceOf (String(), true, false), s5); expectEquals (s5.fromFirstOccurrenceOf ("xword2", true, false), s5.substring (100)); expectEquals (s5.fromFirstOccurrenceOf (String (L"word2"), true, false), s5.substring (5)); expectEquals (s5.fromFirstOccurrenceOf ("Word2", true, true), s5.substring (5)); expectEquals (s5.fromFirstOccurrenceOf ("word2", false, false), s5.getLastCharacters (6)); expectEquals (s5.fromFirstOccurrenceOf ("Word2", false, true), s5.getLastCharacters (6)); - expectEquals (s5.fromLastOccurrenceOf (String::empty, true, false), s5); + expectEquals (s5.fromLastOccurrenceOf (String(), true, false), s5); expectEquals (s5.fromLastOccurrenceOf ("wordx", true, false), s5); expectEquals (s5.fromLastOccurrenceOf ("word", true, false), s5.getLastCharacters (5)); expectEquals (s5.fromLastOccurrenceOf ("worD", true, true), s5.getLastCharacters (5)); expectEquals (s5.fromLastOccurrenceOf ("word", false, false), s5.getLastCharacters (1)); expectEquals (s5.fromLastOccurrenceOf ("worD", false, true), s5.getLastCharacters (1)); - expect (s5.upToFirstOccurrenceOf (String::empty, true, false).isEmpty()); + expect (s5.upToFirstOccurrenceOf (String(), true, false).isEmpty()); expectEquals (s5.upToFirstOccurrenceOf ("word4", true, false), s5); expectEquals (s5.upToFirstOccurrenceOf ("word2", true, false), s5.substring (0, 10)); expectEquals (s5.upToFirstOccurrenceOf ("Word2", true, true), s5.substring (0, 10)); expectEquals (s5.upToFirstOccurrenceOf ("word2", false, false), s5.substring (0, 5)); expectEquals (s5.upToFirstOccurrenceOf ("Word2", false, true), s5.substring (0, 5)); - expectEquals (s5.upToLastOccurrenceOf (String::empty, true, false), s5); + expectEquals (s5.upToLastOccurrenceOf (String(), true, false), s5); expectEquals (s5.upToLastOccurrenceOf ("zword", true, false), s5); expectEquals (s5.upToLastOccurrenceOf ("word", true, false), s5.dropLastCharacters (1)); expectEquals (s5.dropLastCharacters(1).upToLastOccurrenceOf ("word", true, false), s5.dropLastCharacters (1)); @@ -2604,9 +2606,9 @@ public: expect (s5.replaceCharacters ("wo", "xy") != s5); expectEquals (s5.replaceCharacters ("wo", "xy").replaceCharacters ("xy", "wo"), s5); expectEquals (s5.retainCharacters ("1wordxya"), String ("wordwordword")); - expect (s5.retainCharacters (String::empty).isEmpty()); + expect (s5.retainCharacters (String()).isEmpty()); expect (s5.removeCharacters ("1wordxya") == " 2 3"); - expectEquals (s5.removeCharacters (String::empty), s5); + expectEquals (s5.removeCharacters (String()), s5); expect (s5.initialSectionContainingOnly ("word") == L"word"); expect (String ("word").initialSectionContainingOnly ("word") == L"word"); expectEquals (s5.initialSectionNotContaining (String ("xyz ")), String ("word")); @@ -2647,9 +2649,9 @@ public: expectEquals (s.joinIntoString ("-"), String ("4-3-2-1-0")); s.remove (2); expectEquals (s.joinIntoString ("--"), String ("4--3--1--0")); - expectEquals (s.joinIntoString (String::empty), String ("4310")); + expectEquals (s.joinIntoString (StringRef()), String ("4310")); s.clear(); - expectEquals (s.joinIntoString ("x"), String::empty); + expectEquals (s.joinIntoString ("x"), String()); StringArray toks; toks.addTokens ("x,,", ";,", ""); diff --git a/modules/juce_core/text/juce_String.h b/modules/juce_core/text/juce_String.h index e60bcbdefd..0a3b8bccaa 100644 --- a/modules/juce_core/text/juce_String.h +++ b/modules/juce_core/text/juce_String.h @@ -147,13 +147,15 @@ public: ~String() noexcept; //============================================================================== + #if JUCE_ALLOW_STATIC_NULL_VARIABLES /** This is a static empty string object that can be used if you need a reference to one. The value of String::empty is exactly the same as String(), and in almost all cases - it's better to avoid String::empty and just use String() instead, so that the compiler + it's better to avoid String::empty and just use String() or {} instead, so that the compiler only has to reason about locally-constructed objects, rather than taking into account the fact that you're referencing a global shared static memory address. */ static const String empty; + #endif /** This is the character encoding type used internally to store the string. diff --git a/modules/juce_core/text/juce_StringArray.cpp b/modules/juce_core/text/juce_StringArray.cpp index f31c8470b6..3df28610f1 100644 --- a/modules/juce_core/text/juce_StringArray.cpp +++ b/modules/juce_core/text/juce_StringArray.cpp @@ -127,7 +127,12 @@ const String& StringArray::operator[] (const int index) const noexcept if (isPositiveAndBelow (index, strings.size())) return strings.getReference (index); + #if JUCE_ALLOW_STATIC_NULL_VARIABLES return String::empty; + #else + static String empty; + return empty; + #endif } String& StringArray::getReference (const int index) noexcept diff --git a/modules/juce_core/text/juce_TextDiff.cpp b/modules/juce_core/text/juce_TextDiff.cpp index a8bff4e7ee..5044780b12 100644 --- a/modules/juce_core/text/juce_TextDiff.cpp +++ b/modules/juce_core/text/juce_TextDiff.cpp @@ -262,9 +262,9 @@ public: Random r = getRandom(); - testDiff (String::empty, String::empty); - testDiff ("x", String::empty); - testDiff (String::empty, "x"); + testDiff (String(), String()); + testDiff ("x", String()); + testDiff (String(), "x"); testDiff ("x", "x"); testDiff ("x", "y"); testDiff ("xxx", "x"); diff --git a/modules/juce_core/time/juce_PerformanceCounter.h b/modules/juce_core/time/juce_PerformanceCounter.h index 5426636ac5..7d279d88f2 100644 --- a/modules/juce_core/time/juce_PerformanceCounter.h +++ b/modules/juce_core/time/juce_PerformanceCounter.h @@ -60,7 +60,7 @@ public: @param counterName the name used when printing out the statistics @param runsPerPrintout the number of start/stop iterations before calling printStatistics() - @param loggingFile a file to dump the results to - if this is File::nonexistent, + @param loggingFile a file to dump the results to - if this is File(), the results are just written to the debugger output */ PerformanceCounter (const String& counterName, diff --git a/modules/juce_core/xml/juce_XmlElement.cpp b/modules/juce_core/xml/juce_XmlElement.cpp index 5e636200d2..73d4ccf213 100644 --- a/modules/juce_core/xml/juce_XmlElement.cpp +++ b/modules/juce_core/xml/juce_XmlElement.cpp @@ -460,12 +460,22 @@ int XmlElement::getNumAttributes() const noexcept return attributes.size(); } +static const String& getEmptyStringRef() noexcept +{ + #if JUCE_ALLOW_STATIC_NULL_VARIABLES + return String::empty; + #else + static String empty; + return empty; + #endif +} + const String& XmlElement::getAttributeName (const int index) const noexcept { if (const XmlAttributeNode* const att = attributes [index]) return att->name.toString(); - return String::empty; + return getEmptyStringRef(); } const String& XmlElement::getAttributeValue (const int index) const noexcept @@ -473,7 +483,7 @@ const String& XmlElement::getAttributeValue (const int index) const noexcept if (const XmlAttributeNode* const att = attributes [index]) return att->value; - return String::empty; + return getEmptyStringRef(); } XmlElement::XmlAttributeNode* XmlElement::getAttribute (StringRef attributeName) const noexcept @@ -496,7 +506,7 @@ const String& XmlElement::getStringAttribute (StringRef attributeName) const noe if (const XmlAttributeNode* att = getAttribute (attributeName)) return att->value; - return String::empty; + return getEmptyStringRef(); } String XmlElement::getStringAttribute (StringRef attributeName, const String& defaultReturnValue) const diff --git a/modules/juce_data_structures/values/juce_ValueTree.cpp b/modules/juce_data_structures/values/juce_ValueTree.cpp index 1d854799b3..51b041ca2a 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.cpp +++ b/modules/juce_data_structures/values/juce_ValueTree.cpp @@ -627,7 +627,9 @@ ValueTree::ValueTree() noexcept { } +#if JUCE_ALLOW_STATIC_NULL_VARIABLES const ValueTree ValueTree::invalid; +#endif ValueTree::ValueTree (const Identifier& type) : object (new ValueTree::SharedObject (type)) { @@ -721,20 +723,30 @@ ValueTree ValueTree::getParent() const noexcept ValueTree ValueTree::getSibling (const int delta) const noexcept { if (object == nullptr || object->parent == nullptr) - return invalid; + return ValueTree(); const int index = object->parent->indexOf (*this) + delta; return ValueTree (object->parent->children.getObjectPointer (index)); } +static const var& getNullVarRef() noexcept +{ + #if JUCE_ALLOW_STATIC_NULL_VARIABLES + return var::null; + #else + static var nullVar; + return nullVar; + #endif +} + const var& ValueTree::operator[] (const Identifier& name) const noexcept { - return object == nullptr ? var::null : object->properties[name]; + return object == nullptr ? getNullVarRef() : object->properties[name]; } const var& ValueTree::getProperty (const Identifier& name) const noexcept { - return object == nullptr ? var::null : object->properties[name]; + return object == nullptr ? getNullVarRef() : object->properties[name]; } var ValueTree::getProperty (const Identifier& name, const var& defaultReturnValue) const diff --git a/modules/juce_data_structures/values/juce_ValueTree.h b/modules/juce_data_structures/values/juce_ValueTree.h index eb666123a3..52bb8d3c63 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.h +++ b/modules/juce_data_structures/values/juce_ValueTree.h @@ -523,10 +523,13 @@ public: } } + #if JUCE_ALLOW_STATIC_NULL_VARIABLES /** An invalid ValueTree that can be used if you need to return one as an error condition, etc. - This invalid object is equivalent to ValueTree created with its default constructor. + This invalid object is equivalent to ValueTree created with its default constructor, but + you should always prefer to avoid it and use ValueTree() or {} instead. */ static const ValueTree invalid; + #endif /** Returns the total number of references to the shared underlying data structure that this ValueTree is using. diff --git a/modules/juce_graphics/geometry/juce_AffineTransform.cpp b/modules/juce_graphics/geometry/juce_AffineTransform.cpp index a4c1a7e493..f58fe31562 100644 --- a/modules/juce_graphics/geometry/juce_AffineTransform.cpp +++ b/modules/juce_graphics/geometry/juce_AffineTransform.cpp @@ -79,7 +79,9 @@ bool AffineTransform::isIdentity() const noexcept && (mat11 == 1.0f); } +#if JUCE_ALLOW_STATIC_NULL_VARIABLES const AffineTransform AffineTransform::identity; +#endif //============================================================================== AffineTransform AffineTransform::followedBy (const AffineTransform& other) const noexcept diff --git a/modules/juce_graphics/geometry/juce_AffineTransform.h b/modules/juce_graphics/geometry/juce_AffineTransform.h index 77bb8ab7bb..7562aedbe0 100644 --- a/modules/juce_graphics/geometry/juce_AffineTransform.h +++ b/modules/juce_graphics/geometry/juce_AffineTransform.h @@ -67,15 +67,13 @@ public: /** Compares two transforms. */ bool operator!= (const AffineTransform& other) const noexcept; - /** A ready-to-use identity transform, which you can use to append other - transformations to. - - e.g. @code - AffineTransform myTransform = AffineTransform().rotated (.5f) - .scaled (2.0f); - @endcode + #if JUCE_ALLOW_STATIC_NULL_VARIABLES + /** A ready-to-use identity transform. + Note that you should always avoid using a static variable like this, and + prefer AffineTransform() or {} if you need a default-constructed instance. */ static const AffineTransform identity; + #endif //============================================================================== /** Transforms a 2D coordinate using this matrix. */ diff --git a/modules/juce_graphics/images/juce_Image.cpp b/modules/juce_graphics/images/juce_Image.cpp index 2bf79eb8d6..4e6f4c6340 100644 --- a/modules/juce_graphics/images/juce_Image.cpp +++ b/modules/juce_graphics/images/juce_Image.cpp @@ -259,7 +259,9 @@ Image::~Image() { } +#if JUCE_ALLOW_STATIC_NULL_VARIABLES const Image Image::null; +#endif int Image::getReferenceCount() const noexcept { return image == nullptr ? 0 : image->getSharedCount(); } int Image::getWidth() const noexcept { return image == nullptr ? 0 : image->width; } diff --git a/modules/juce_graphics/images/juce_Image.h b/modules/juce_graphics/images/juce_Image.h index d246739c12..e817cc7f4f 100644 --- a/modules/juce_graphics/images/juce_Image.h +++ b/modules/juce_graphics/images/juce_Image.h @@ -146,10 +146,13 @@ public: */ inline bool isNull() const noexcept { return image == nullptr; } + #if JUCE_ALLOW_STATIC_NULL_VARIABLES /** A null Image object that can be used when you need to return an invalid image. - This object is the equivalient to an Image created with the default constructor. + This object is the equivalient to an Image created with the default constructor, and + you should always prefer to use Image() or {} when you need an empty image object. */ static const Image null; + #endif //============================================================================== /** Returns the image's width (in pixels). */ diff --git a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp index d2da022f96..dd52f6f21f 100644 --- a/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_HyperlinkButton.cpp @@ -35,7 +35,7 @@ HyperlinkButton::HyperlinkButton (const String& linkText, } HyperlinkButton::HyperlinkButton() - : Button (String::empty), + : Button (String()), font (14.0f, Font::underlined), resizeFont (true), justification (Justification::centred) diff --git a/modules/juce_gui_basics/buttons/juce_ImageButton.h b/modules/juce_gui_basics/buttons/juce_ImageButton.h index fed3cad400..e2669800d9 100644 --- a/modules/juce_gui_basics/buttons/juce_ImageButton.h +++ b/modules/juce_gui_basics/buttons/juce_ImageButton.h @@ -46,7 +46,7 @@ public: @param name the name to give the component */ - explicit ImageButton (const String& name = String::empty); + explicit ImageButton (const String& name = String()); /** Destructor. */ ~ImageButton(); diff --git a/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp b/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp index c9a68d732d..fd838075b7 100644 --- a/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_ToggleButton.cpp @@ -23,7 +23,7 @@ */ ToggleButton::ToggleButton() - : Button (String::empty) + : Button (String()) { setClickingTogglesState (true); } diff --git a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h index 2c015de832..3e2258febb 100644 --- a/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h +++ b/modules/juce_gui_basics/filebrowser/juce_DirectoryContentsList.h @@ -179,7 +179,7 @@ public: /** Returns one of the files in the list. @param index should be less than getNumFiles(). If this is out-of-range, the - return value will be File::nonexistent + return value will be a default File() object @see getNumFiles, getFileInfo */ File getFile (int index) const; diff --git a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp index afe498a226..6c6e57f6fd 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.cpp @@ -26,7 +26,7 @@ FileBrowserComponent::FileBrowserComponent (int flags_, const File& initialFileOrDirectory, const FileFilter* fileFilter_, FilePreviewComponent* previewComp_) - : FileFilter (String::empty), + : FileFilter (String()), fileFilter (fileFilter_), flags (flags_), previewComp (previewComp_), @@ -44,7 +44,7 @@ FileBrowserComponent::FileBrowserComponent (int flags_, String filename; - if (initialFileOrDirectory == File::nonexistent) + if (initialFileOrDirectory == File()) { currentRoot = File::getCurrentWorkingDirectory(); } @@ -391,7 +391,7 @@ void FileBrowserComponent::fileDoubleClicked (const File& f) setRoot (f); if ((flags & canSelectDirectories) != 0 && (flags & doNotClearFileNameOnRootChange) == 0) - filenameBox.setText (String::empty); + filenameBox.setText (String()); } else { @@ -535,8 +535,8 @@ void FileBrowserComponent::getDefaultRoots (StringArray& rootNames, StringArray& rootNames.add (name); } - rootPaths.add (String::empty); - rootNames.add (String::empty); + rootPaths.add (String()); + rootNames.add (String()); rootPaths.add (File::getSpecialLocation (File::userDocumentsDirectory).getFullPathName()); rootNames.add (TRANS("Documents")); @@ -559,8 +559,8 @@ void FileBrowserComponent::getDefaultRoots (StringArray& rootNames, StringArray& rootPaths.add (File::getSpecialLocation (File::userDesktopDirectory).getFullPathName()); rootNames.add (TRANS("Desktop")); - rootPaths.add (String::empty); - rootNames.add (String::empty); + rootPaths.add (String()); + rootNames.add (String()); Array volumes; File vol ("/Volumes"); diff --git a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h index b4431fbd2e..058a36de46 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileBrowserComponent.h @@ -74,7 +74,7 @@ public: specify the component's behaviour. The flags must contain either openMode or saveMode, and canSelectFiles and/or canSelectDirectories. @param initialFileOrDirectory The file or directory that should be selected when the component begins. - If this is File::nonexistent, a default directory will be chosen. + If this is File(), a default directory will be chosen. @param fileFilter an optional filter to use to determine which files are shown. If this is nullptr then all files are displayed. Note that a pointer is kept internally to this object, so make sure that it is not deleted diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooser.h b/modules/juce_gui_basics/filebrowser/juce_FileChooser.h index f7399751b9..e6a35d50aa 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooser.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooser.h @@ -64,8 +64,8 @@ public: tell the user what's going on @param initialFileOrDirectory the file or directory that should be selected when the dialog box opens. If this parameter is - set to File::nonexistent, a sensible default - directory will be used instead. + set to File(), a sensible default directory will + be used instead. @param filePatternsAllowed a set of file patterns to specify which files can be selected - each pattern should be separated by a comma or semi-colon, e.g. "*" or @@ -82,8 +82,8 @@ public: @see browseForFileToOpen, browseForFileToSave, browseForDirectory */ FileChooser (const String& dialogBoxTitle, - const File& initialFileOrDirectory = File::nonexistent, - const String& filePatternsAllowed = String::empty, + const File& initialFileOrDirectory = File(), + const String& filePatternsAllowed = String(), bool useOSNativeDialogBox = true, bool treatFilePackagesAsDirectories = false); diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp index 52fa007955..ef851cbf9a 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp @@ -238,7 +238,7 @@ void FileChooserDialogBox::createNewFolder() TRANS("Please enter the name for the folder"), AlertWindow::NoIcon, this); - aw->addTextEditor ("Folder Name", String::empty, String::empty, false); + aw->addTextEditor ("Folder Name", String(), String(), false); aw->addButton (TRANS("Create Folder"), 1, KeyPress (KeyPress::returnKey)); aw->addButton (TRANS("Cancel"), 0, KeyPress (KeyPress::escapeKey)); diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h index 2f1a993cf7..f0e82bb448 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.h @@ -37,10 +37,10 @@ @code { - WildcardFileFilter wildcardFilter ("*.foo", String::empty, "Foo files"); + WildcardFileFilter wildcardFilter ("*.foo", String(), "Foo files"); FileBrowserComponent browser (FileBrowserComponent::canSelectFiles, - File::nonexistent, + File(), &wildcardFilter, nullptr); diff --git a/modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp index d12dd41afa..2333dcc82d 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileListComponent.cpp @@ -27,7 +27,7 @@ Image juce_createIconForFile (const File& file); //============================================================================== FileListComponent::FileListComponent (DirectoryContentsList& listToShow) - : ListBox (String::empty, nullptr), + : ListBox (String(), nullptr), DirectoryContentsDisplayComponent (listToShow) { setModel (this); @@ -159,7 +159,7 @@ public: repaint(); } - if (file != File::nonexistent && icon.isNull() && ! isDirectory) + if (file != File() && icon.isNull() && ! isDirectory) { updateIcon (true); diff --git a/modules/juce_gui_basics/filebrowser/juce_FilePreviewComponent.h b/modules/juce_gui_basics/filebrowser/juce_FilePreviewComponent.h index d09d563873..a1c342b9a6 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FilePreviewComponent.h +++ b/modules/juce_gui_basics/filebrowser/juce_FilePreviewComponent.h @@ -51,7 +51,7 @@ public: /** Called to indicate that the user's currently selected file has changed. @param newSelectedFile the newly selected file or directory, which may be - File::nonexistent if none is selected. + a defualt File() object if none is selected. */ virtual void selectedFileChanged (const File& newSelectedFile) = 0; diff --git a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp index 3239085fc3..6c9364ef51 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileSearchPathListComponent.cpp @@ -26,8 +26,8 @@ FileSearchPathListComponent::FileSearchPathListComponent() : addButton ("+"), removeButton ("-"), changeButton (TRANS ("change...")), - upButton (String::empty, DrawableButton::ImageOnButtonBackground), - downButton (String::empty, DrawableButton::ImageOnButtonBackground) + upButton (String(), DrawableButton::ImageOnButtonBackground), + downButton (String(), DrawableButton::ImageOnButtonBackground) { listBox.setModel (this); addAndMakeVisible (listBox); @@ -222,10 +222,10 @@ void FileSearchPathListComponent::buttonClicked (Button* button) { File start (defaultBrowseTarget); - if (start == File::nonexistent) + if (start == File()) start = path [0]; - if (start == File::nonexistent) + if (start == File()) start = File::getCurrentWorkingDirectory(); #if JUCE_MODAL_LOOPS_PERMITTED diff --git a/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp index 178a10b3d5..6565ba4619 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileTreeComponent.cpp @@ -172,7 +172,7 @@ public: void paintItem (Graphics& g, int width, int height) override { - if (file != File::nonexistent) + if (file != File()) { updateIcon (true); @@ -285,7 +285,7 @@ File FileTreeComponent::getSelectedFile (const int index) const if (const FileListTreeItem* const item = dynamic_cast (getSelectedItem (index))) return item->file; - return File::nonexistent; + return File(); } void FileTreeComponent::deselectAllFiles() diff --git a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp index 2a69425e4b..6cfc09b70f 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FilenameComponent.cpp @@ -105,8 +105,8 @@ void FilenameComponent::setDefaultBrowseTarget (const File& newDefaultDirectory) File FilenameComponent::getLocationToBrowse() { - return getCurrentFile() == File::nonexistent ? defaultBrowseFile - : getCurrentFile(); + return getCurrentFile() == File() ? defaultBrowseFile + : getCurrentFile(); } void FilenameComponent::buttonClicked (Button*) diff --git a/modules/juce_gui_basics/layout/juce_GroupComponent.h b/modules/juce_gui_basics/layout/juce_GroupComponent.h index 02ba492cef..8ad22e939a 100644 --- a/modules/juce_gui_basics/layout/juce_GroupComponent.h +++ b/modules/juce_gui_basics/layout/juce_GroupComponent.h @@ -41,8 +41,8 @@ public: @param componentName the name to give the component @param labelText the text to show at the top of the outline */ - GroupComponent (const String& componentName = String::empty, - const String& labelText = String::empty); + GroupComponent (const String& componentName = String(), + const String& labelText = String()); /** Destructor. */ ~GroupComponent(); diff --git a/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp b/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp index 69c40bb9fa..b81a3f1a73 100644 --- a/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp +++ b/modules/juce_gui_basics/layout/juce_MultiDocumentPanel.cpp @@ -23,7 +23,7 @@ */ MultiDocumentPanelWindow::MultiDocumentPanelWindow (Colour backgroundColour) - : DocumentWindow (String::empty, backgroundColour, + : DocumentWindow (String(), backgroundColour, DocumentWindow::maximiseButton | DocumentWindow::closeButton, false) { } diff --git a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp index 04907cff9e..ee9d20290b 100644 --- a/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp +++ b/modules/juce_gui_basics/layout/juce_TabbedButtonBar.cpp @@ -321,7 +321,7 @@ int TabbedButtonBar::getNumTabs() const String TabbedButtonBar::getCurrentTabName() const { TabInfo* tab = tabs [currentTabIndex]; - return tab == nullptr ? String::empty : tab->name; + return tab == nullptr ? String() : tab->name; } StringArray TabbedButtonBar::getTabNames() const diff --git a/modules/juce_gui_basics/layout/juce_Viewport.h b/modules/juce_gui_basics/layout/juce_Viewport.h index fe3d5fb45c..ee73e27709 100644 --- a/modules/juce_gui_basics/layout/juce_Viewport.h +++ b/modules/juce_gui_basics/layout/juce_Viewport.h @@ -50,7 +50,7 @@ public: The viewport is initially empty - use the setViewedComponent() method to add a child component for it to manage. */ - explicit Viewport (const String& componentName = String::empty); + explicit Viewport (const String& componentName = String()); /** Destructor. */ ~Viewport(); diff --git a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp index c151eec9d3..17c4c60400 100644 --- a/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp +++ b/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp @@ -1176,7 +1176,7 @@ Font LookAndFeel_V2::getComboBoxFont (ComboBox& box) Label* LookAndFeel_V2::createComboBoxTextBox (ComboBox&) { - return new Label (String::empty, String::empty); + return new Label (String(), String()); } void LookAndFeel_V2::positionComboBoxText (ComboBox& box, Label& label) @@ -1454,13 +1454,13 @@ void LookAndFeel_V2::drawRotarySlider (Graphics& g, int x, int y, int width, int Button* LookAndFeel_V2::createSliderButton (Slider&, const bool isIncrement) { - return new TextButton (isIncrement ? "+" : "-", String::empty); + return new TextButton (isIncrement ? "+" : "-", String()); } class LookAndFeel_V2::SliderLabelComp : public Label { public: - SliderLabelComp() : Label (String::empty, String::empty) {} + SliderLabelComp() : Label (String(), String()) {} void mouseWheelMove (const MouseEvent&, const MouseWheelDetails&) {} }; diff --git a/modules/juce_gui_basics/menus/juce_MenuBarModel.h b/modules/juce_gui_basics/menus/juce_MenuBarModel.h index 8d38c8e48c..4267661f6e 100644 --- a/modules/juce_gui_basics/menus/juce_MenuBarModel.h +++ b/modules/juce_gui_basics/menus/juce_MenuBarModel.h @@ -157,7 +157,7 @@ public: */ static void setMacMainMenu (MenuBarModel* newMenuBarModel, const PopupMenu* extraAppleMenuItems = nullptr, - const String& recentItemsMenuName = String::empty); + const String& recentItemsMenuName = String()); /** OSX ONLY - Returns the menu model that is currently being shown as the main menu bar. diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.h b/modules/juce_gui_basics/menus/juce_PopupMenu.h index c2122d6fd4..76b18a2e7a 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.h +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.h @@ -242,7 +242,7 @@ public: */ void addCommandItem (ApplicationCommandManager* commandManager, CommandID commandID, - const String& displayName = String::empty, + const String& displayName = String(), Drawable* iconToUse = nullptr); diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp index 5896787c9f..e81872b7bd 100644 --- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp @@ -3513,7 +3513,7 @@ private: if (Atoms::isMimeTypeFile (dragAndDropCurrentMimeType)) { for (int i = 0; i < lines.size(); ++i) - dragInfo.files.add (URL::removeEscapeChars (lines[i].replace ("file://", String::empty, true))); + dragInfo.files.add (URL::removeEscapeChars (lines[i].replace ("file://", String(), true))); dragInfo.files.trim(); dragInfo.files.removeEmptyStrings(); @@ -4159,7 +4159,7 @@ void JUCE_CALLTYPE NativeMessageBox::showMessageBoxAsync (AlertWindow::AlertIcon Component* associatedComponent, ModalComponentManager::Callback* callback) { - AlertWindow::showMessageBoxAsync (iconType, title, message, String::empty, associatedComponent, callback); + AlertWindow::showMessageBoxAsync (iconType, title, message, String(), associatedComponent, callback); } bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType iconType, @@ -4167,7 +4167,7 @@ bool JUCE_CALLTYPE NativeMessageBox::showOkCancelBox (AlertWindow::AlertIconType Component* associatedComponent, ModalComponentManager::Callback* callback) { - return AlertWindow::showOkCancelBox (iconType, title, message, String::empty, String::empty, + return AlertWindow::showOkCancelBox (iconType, title, message, String(), String(), associatedComponent, callback); } @@ -4177,7 +4177,7 @@ int JUCE_CALLTYPE NativeMessageBox::showYesNoCancelBox (AlertWindow::AlertIconTy ModalComponentManager::Callback* callback) { return AlertWindow::showYesNoCancelBox (iconType, title, message, - String::empty, String::empty, String::empty, + String(), String(), String(), associatedComponent, callback); } diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index 42cfd93ad6..69f4a64b0d 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -151,7 +151,7 @@ void FileChooser::showPlatformDialog (Array& results, tempMenu = new TemporaryMainMenuWithStandardCommands(); StringArray* filters = new StringArray(); - filters->addTokens (filter.replaceCharacters (",:", ";;"), ";", String::empty); + filters->addTokens (filter.replaceCharacters (",:", ";;"), ";", String()); filters->trim(); filters->removeEmptyStrings(); diff --git a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm index fa656385c0..10de90b737 100644 --- a/modules/juce_gui_basics/native/juce_mac_MainMenu.mm +++ b/modules/juce_gui_basics/native/juce_mac_MainMenu.mm @@ -39,7 +39,7 @@ public: ~JuceMainMenuHandler() { - setMenu (nullptr, nullptr, String::empty); + setMenu (nullptr, nullptr, String()); jassert (instance == this); instance = nullptr; diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index ecb71b12e1..e98a7b0be7 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -242,9 +242,9 @@ public: void setRepresentedFile (const File& file) override { if (! isSharedWindow) - [window setRepresentedFilename: juceStringToNS (file != File::nonexistent + [window setRepresentedFilename: juceStringToNS (file != File() ? file.getFullPathName() - : String::empty)]; + : String())]; } void setBounds (const Rectangle& newBounds, bool isNowFullScreen) override diff --git a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp index ad11d4063d..a6076a4228 100644 --- a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp +++ b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp @@ -147,7 +147,7 @@ void FileChooser::showPlatformDialog (Array& results, const String& title_ // use a modal window as the parent for this dialog box // to block input from other app windows - Component parentWindow (String::empty); + Component parentWindow; const Rectangle mainMon (Desktop::getInstance().getDisplays().getMainDisplay().userArea); parentWindow.setBounds (mainMon.getX() + mainMon.getWidth() / 4, mainMon.getY() + mainMon.getHeight() / 4, diff --git a/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp b/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp index 99eccbd9ca..d13fa0e4b1 100644 --- a/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp +++ b/modules/juce_gui_basics/properties/juce_PropertyPanel.cpp @@ -238,7 +238,7 @@ void PropertyPanel::addProperties (const Array& newPropertie if (isEmpty()) repaint(); - propertyHolderComponent->insertSection (-1, new SectionComponent (String::empty, newProperties, true)); + propertyHolderComponent->insertSection (-1, new SectionComponent (String(), newProperties, true)); updatePropHolderLayout(); } diff --git a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp index f765cd0a0f..5a52f9c610 100644 --- a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp @@ -27,7 +27,7 @@ class TextPropertyComponent::LabelComp : public Label, { public: LabelComp (TextPropertyComponent& tpc, const int charLimit, const bool multiline) - : Label (String::empty, String::empty), + : Label (String(), String()), owner (tpc), maxChars (charLimit), isMultiline (multiline) diff --git a/modules/juce_gui_basics/widgets/juce_ComboBox.cpp b/modules/juce_gui_basics/widgets/juce_ComboBox.cpp index 85e67108b3..13fc1644c9 100644 --- a/modules/juce_gui_basics/widgets/juce_ComboBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_ComboBox.cpp @@ -112,7 +112,7 @@ void ComboBox::addItem (const String& newItemText, const int newItemId) if (separatorPending) { separatorPending = false; - items.add (new ItemInfo (String::empty, 0, false, false)); + items.add (new ItemInfo (String(), 0, false, false)); } items.add (new ItemInfo (newItemText, newItemId, true, false)); @@ -140,7 +140,7 @@ void ComboBox::addSectionHeading (const String& headingName) if (separatorPending) { separatorPending = false; - items.add (new ItemInfo (String::empty, 0, false, false)); + items.add (new ItemInfo (String(), 0, false, false)); } items.add (new ItemInfo (headingName, 0, true, true)); @@ -219,7 +219,7 @@ String ComboBox::getItemText (const int index) const if (const ItemInfo* const item = getItemForIndex (index)) return item->name; - return String::empty; + return String(); } int ComboBox::getItemId (const int index) const noexcept @@ -274,7 +274,7 @@ int ComboBox::getSelectedId() const noexcept void ComboBox::setSelectedId (const int newItemId, const NotificationType notification) { const ItemInfo* const item = getItemForId (newItemId); - const String newItemText (item != nullptr ? item->name : String::empty); + const String newItemText (item != nullptr ? item->name : String()); if (lastCurrentId != newItemId || label->getText() != newItemText) { diff --git a/modules/juce_gui_basics/widgets/juce_ComboBox.h b/modules/juce_gui_basics/widgets/juce_ComboBox.h index 1e876cbac2..ca05da6c99 100644 --- a/modules/juce_gui_basics/widgets/juce_ComboBox.h +++ b/modules/juce_gui_basics/widgets/juce_ComboBox.h @@ -57,7 +57,7 @@ public: @param componentName the name to set for the component (see Component::setName()) */ - explicit ComboBox (const String& componentName = String::empty); + explicit ComboBox (const String& componentName = String()); /** Destructor. */ ~ComboBox(); diff --git a/modules/juce_gui_basics/widgets/juce_ImageComponent.h b/modules/juce_gui_basics/widgets/juce_ImageComponent.h index 584f35fb8f..0c7bad43d6 100644 --- a/modules/juce_gui_basics/widgets/juce_ImageComponent.h +++ b/modules/juce_gui_basics/widgets/juce_ImageComponent.h @@ -38,7 +38,7 @@ class JUCE_API ImageComponent : public Component, public: //============================================================================== /** Creates an ImageComponent. */ - ImageComponent (const String& componentName = String::empty); + ImageComponent (const String& componentName = String()); /** Destructor. */ ~ImageComponent(); diff --git a/modules/juce_gui_basics/widgets/juce_Label.h b/modules/juce_gui_basics/widgets/juce_Label.h index 8c18f690f3..dfb74ef00e 100644 --- a/modules/juce_gui_basics/widgets/juce_Label.h +++ b/modules/juce_gui_basics/widgets/juce_Label.h @@ -44,8 +44,8 @@ public: @param componentName the name to give the component @param labelText the text to show in the label */ - Label (const String& componentName = String::empty, - const String& labelText = String::empty); + Label (const String& componentName = String(), + const String& labelText = String()); /** Destructor. */ ~Label(); diff --git a/modules/juce_gui_basics/widgets/juce_ListBox.cpp b/modules/juce_gui_basics/widgets/juce_ListBox.cpp index e026d3d7fc..5aa9ff58a3 100644 --- a/modules/juce_gui_basics/widgets/juce_ListBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_ListBox.cpp @@ -138,7 +138,7 @@ public: if (ListBoxModel* m = owner.getModel()) return m->getTooltipForRow (row); - return String::empty; + return String(); } ScopedPointer customComponent; @@ -964,5 +964,5 @@ void ListBoxModel::deleteKeyPressed (int) {} void ListBoxModel::returnKeyPressed (int) {} void ListBoxModel::listWasScrolled() {} var ListBoxModel::getDragSourceDescription (const SparseSet&) { return var(); } -String ListBoxModel::getTooltipForRow (int) { return String::empty; } +String ListBoxModel::getTooltipForRow (int) { return String(); } MouseCursor ListBoxModel::getMouseCursorForRow (int) { return MouseCursor::NormalCursor; } diff --git a/modules/juce_gui_basics/widgets/juce_ListBox.h b/modules/juce_gui_basics/widgets/juce_ListBox.h index ada3b5f65b..436be0f299 100644 --- a/modules/juce_gui_basics/widgets/juce_ListBox.h +++ b/modules/juce_gui_basics/widgets/juce_ListBox.h @@ -184,7 +184,7 @@ public: The model pointer passed-in can be null, in which case you can set it later with setModel(). */ - ListBox (const String& componentName = String::empty, + ListBox (const String& componentName = String(), ListBoxModel* model = nullptr); /** Destructor. */ diff --git a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp index 13fee7e23d..8f2fdf5ec2 100644 --- a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp +++ b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp @@ -95,7 +95,7 @@ String TableHeaderComponent::getColumnName (const int columnId) const if (const ColumnInfo* const ci = getInfoForId (columnId)) return ci->name; - return String::empty; + return String(); } void TableHeaderComponent::setColumnName (const int columnId, const String& newName) diff --git a/modules/juce_gui_basics/widgets/juce_Toolbar.cpp b/modules/juce_gui_basics/widgets/juce_Toolbar.cpp index 9d89ca8e64..5c450d9888 100644 --- a/modules/juce_gui_basics/widgets/juce_Toolbar.cpp +++ b/modules/juce_gui_basics/widgets/juce_Toolbar.cpp @@ -29,7 +29,7 @@ class Toolbar::Spacer : public ToolbarItemComponent { public: Spacer (const int itemId_, const float fixedSize_, const bool drawBar_) - : ToolbarItemComponent (itemId_, String::empty, false), + : ToolbarItemComponent (itemId_, String(), false), fixedSize (fixedSize_), drawBar (drawBar_) { @@ -709,9 +709,9 @@ private: public: CustomiserPanel (ToolbarItemFactory& tbf, Toolbar& bar, int optionFlags) : factory (tbf), toolbar (bar), palette (tbf, bar), - instructions (String::empty, TRANS ("You can drag the items above and drop them onto a toolbar to add them.") - + "\n\n" - + TRANS ("Items on the toolbar can also be dragged around to change their order, or dragged off the edge to delete them.")), + instructions (String(), TRANS ("You can drag the items above and drop them onto a toolbar to add them.") + + "\n\n" + + TRANS ("Items on the toolbar can also be dragged around to change their order, or dragged off the edge to delete them.")), defaultButton (TRANS ("Restore to default set of items")) { addAndMakeVisible (palette); diff --git a/modules/juce_gui_basics/widgets/juce_TreeView.cpp b/modules/juce_gui_basics/widgets/juce_TreeView.cpp index 69a40c5c0a..b4b3418785 100644 --- a/modules/juce_gui_basics/widgets/juce_TreeView.cpp +++ b/modules/juce_gui_basics/widgets/juce_TreeView.cpp @@ -1091,7 +1091,7 @@ void TreeView::fileDragEnter (const StringArray& files, int x, int y) void TreeView::fileDragMove (const StringArray& files, int x, int y) { - handleDrag (files, SourceDetails (String::empty, this, Point (x, y))); + handleDrag (files, SourceDetails (String(), this, Point (x, y))); } void TreeView::fileDragExit (const StringArray&) @@ -1101,7 +1101,7 @@ void TreeView::fileDragExit (const StringArray&) void TreeView::filesDropped (const StringArray& files, int x, int y) { - handleDrop (files, SourceDetails (String::empty, this, Point (x, y))); + handleDrop (files, SourceDetails (String(), this, Point (x, y))); } bool TreeView::isInterestedInDragSource (const SourceDetails& /*dragSourceDetails*/) @@ -1156,7 +1156,7 @@ TreeViewItem::~TreeViewItem() String TreeViewItem::getUniqueName() const { - return String::empty; + return String(); } void TreeViewItem::itemOpennessChanged (bool) @@ -1378,7 +1378,7 @@ void TreeViewItem::itemSelectionChanged (bool) String TreeViewItem::getTooltip() { - return String::empty; + return String(); } void TreeViewItem::ownerViewChanged (TreeView*) diff --git a/modules/juce_gui_basics/widgets/juce_TreeView.h b/modules/juce_gui_basics/widgets/juce_TreeView.h index 1ab9c0c754..78c064b4f4 100644 --- a/modules/juce_gui_basics/widgets/juce_TreeView.h +++ b/modules/juce_gui_basics/widgets/juce_TreeView.h @@ -645,7 +645,7 @@ public: Once you've got a treeview component, you'll need to give it something to display, using the setRootItem() method. */ - TreeView (const String& componentName = String::empty); + TreeView (const String& componentName = String()); /** Destructor. */ ~TreeView(); diff --git a/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp b/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp index e18d767a61..ca74804c2c 100644 --- a/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp +++ b/modules/juce_gui_extra/documents/juce_FileBasedDocument.cpp @@ -142,7 +142,7 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAs (const File& newFile, const bool askUserForFileIfNotSpecified, const bool showMessageOnFailure) { - if (newFile == File::nonexistent) + if (newFile == File()) { if (askUserForFileIfNotSpecified) return saveAsInteractive (true); diff --git a/modules/juce_gui_extra/documents/juce_FileBasedDocument.h b/modules/juce_gui_extra/documents/juce_FileBasedDocument.h index cd903b8aeb..eab3d1e318 100644 --- a/modules/juce_gui_extra/documents/juce_FileBasedDocument.h +++ b/modules/juce_gui_extra/documents/juce_FileBasedDocument.h @@ -203,7 +203,7 @@ public: //============================================================================== /** Returns the file that this document was last successfully saved or loaded from. - When the document object is created, this will be set to File::nonexistent. + When the document object is created, this will be set to File(). It is changed when one of the load or save methods is used, or when setFile() is used to explicitly set it. @@ -249,8 +249,8 @@ protected: This method works very well in conjunction with a RecentlyOpenedFilesList object to manage your recent-files list. - As a default value, it's ok to return File::nonexistent, and the document - object will use a sensible one instead. + As a default value, it's ok to return File(), and the document object will + use a sensible one instead. @see RecentlyOpenedFilesList */ diff --git a/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp b/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp index 3014021ab2..efce528b87 100644 --- a/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp +++ b/modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp @@ -42,7 +42,7 @@ public: void paintButton (Graphics& g, bool /*isOver*/, bool /*isDown*/) override { getLookAndFeel().drawKeymapChangeButton (g, getWidth(), getHeight(), *this, - keyNum >= 0 ? getName() : String::empty); + keyNum >= 0 ? getName() : String()); } static void menuCallback (int result, ChangeKeyButton* button) @@ -219,7 +219,7 @@ public: for (int i = 0; i < jmin ((int) maxNumAssignments, keyPresses.size()); ++i) addKeyPressButton (owner.getDescriptionForKeyPress (keyPresses.getReference (i)), i, isReadOnly); - addKeyPressButton (String::empty, -1, isReadOnly); + addKeyPressButton (String(), -1, isReadOnly); } void addKeyPressButton (const String& desc, const int index, const bool isReadOnly) @@ -386,7 +386,7 @@ public: TRANS("Reset to defaults"), TRANS("Are you sure you want to reset all the key-mappings to their default state?"), TRANS("Reset"), - String::empty, + String(), &owner, ModalCallbackFunction::forComponent (resetToDefaultsCallback, &owner)); } diff --git a/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp b/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp index 8737955c74..e7fd60b599 100644 --- a/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp +++ b/modules/juce_gui_extra/native/juce_win32_SystemTrayIcon.cpp @@ -226,7 +226,7 @@ void SystemTrayIconComponent::showInfoBubble (const String& title, const String& void SystemTrayIconComponent::hideInfoBubble() { - showInfoBubble (String::empty, String::empty); + showInfoBubble (String(), String()); } void* SystemTrayIconComponent::getNativeHandle() const diff --git a/modules/juce_video/native/juce_mac_QuickTimeMovieComponent.mm b/modules/juce_video/native/juce_mac_QuickTimeMovieComponent.mm index 4af327ecdb..a47e447260 100644 --- a/modules/juce_video/native/juce_mac_QuickTimeMovieComponent.mm +++ b/modules/juce_video/native/juce_mac_QuickTimeMovieComponent.mm @@ -188,7 +188,7 @@ void QuickTimeMovieComponent::closeMovie() [view setMovie: nil]; [theMovie release]; movie = 0; - movieFile = File::nonexistent; + movieFile = File(); } bool QuickTimeMovieComponent::isMovieOpen() const diff --git a/modules/juce_video/native/juce_win32_QuickTimeMovieComponent.cpp b/modules/juce_video/native/juce_win32_QuickTimeMovieComponent.cpp index 9d7edc08e2..c60ad41a7a 100644 --- a/modules/juce_video/native/juce_win32_QuickTimeMovieComponent.cpp +++ b/modules/juce_video/native/juce_win32_QuickTimeMovieComponent.cpp @@ -101,7 +101,7 @@ void QuickTimeMovieComponent::createControlIfNeeded() pimpl->qtControl->QuickTimeInitialize(); pimpl->qtControl->PutSizing (qtMovieFitsControl); - if (movieFile != File::nonexistent) + if (movieFile != File()) loadMovie (movieFile, controllerVisible); } } @@ -118,7 +118,7 @@ bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, { const ScopedPointer movieStreamDeleter (movieStream); - movieFile = File::nonexistent; + movieFile = File(); movieLoaded = false; pimpl->qtMovie = 0; controllerVisible = isControllerVisible; @@ -162,7 +162,7 @@ bool QuickTimeMovieComponent::loadMovie (InputStream* movieStream, void QuickTimeMovieComponent::closeMovie() { stop(); - movieFile = File::nonexistent; + movieFile = File(); movieLoaded = false; pimpl->qtMovie = 0; diff --git a/modules/juce_video/playback/juce_QuickTimeMovieComponent.h b/modules/juce_video/playback/juce_QuickTimeMovieComponent.h index cd8201bd50..ae158b2f84 100644 --- a/modules/juce_video/playback/juce_QuickTimeMovieComponent.h +++ b/modules/juce_video/playback/juce_QuickTimeMovieComponent.h @@ -109,8 +109,7 @@ public: void closeMovie(); /** Returns the movie file that is currently open. - - If there isn't one, this returns File::nonexistent + If there isn't one, this returns File() */ File getCurrentMovieFile() const;