diff --git a/examples/OSCMonitor/Source/OSCLogListBox.h b/examples/OSCMonitor/Source/OSCLogListBox.h index de15b003b4..3cc04d83de 100644 --- a/examples/OSCMonitor/Source/OSCLogListBox.h +++ b/examples/OSCMonitor/Source/OSCLogListBox.h @@ -29,17 +29,16 @@ #include "../JuceLibraryCode/JuceHeader.h" //============================================================================== -class OSCLogListBox : public ListBox, private ListBoxModel, private AsyncUpdater +class OSCLogListBox : public ListBox, + private ListBoxModel, + private AsyncUpdater { public: - - //============================================================================== OSCLogListBox() { setModel (this); } - //============================================================================== ~OSCLogListBox() { } @@ -161,14 +160,11 @@ public: } private: - - //============================================================================== - String getIndentationString (int level) + static String getIndentationString (int level) { return String().paddedRight (' ', 2 * level); } - //============================================================================== StringArray oscLogList; diff --git a/examples/OSCSender/Source/MainComponent.h b/examples/OSCSender/Source/MainComponent.h index 438b84b0c8..1f044fe780 100644 --- a/examples/OSCSender/Source/MainComponent.h +++ b/examples/OSCSender/Source/MainComponent.h @@ -34,10 +34,10 @@ This component lives inside our window, and this is where you should put all your controls and content. */ -class MainContentComponent : public Component, private Slider::Listener +class MainContentComponent : public Component, + private Slider::Listener { public: - //============================================================================== MainContentComponent() { setSize (200, 200); diff --git a/extras/Projucer/Source/Licenses/jucer_LicenseWebview.h b/extras/Projucer/Source/Licenses/jucer_LicenseWebview.h index fa22257e5a..45cc67991a 100644 --- a/extras/Projucer/Source/Licenses/jucer_LicenseWebview.h +++ b/extras/Projucer/Source/Licenses/jucer_LicenseWebview.h @@ -78,8 +78,9 @@ private: }; //============================================================================== - struct Header : public Component, private LicenseController::StateChangedCallback, - private Button::Listener + struct Header : public Component, + private LicenseController::StateChangedCallback, + private Button::Listener { Header() : avatarButton ("User Settings", &getIcons().user) { diff --git a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp index 450acc45a0..3f901341cc 100644 --- a/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp @@ -414,7 +414,8 @@ namespace AAXClasses //============================================================================== class JuceAAX_Processor; - class JuceAAX_GUI : public AAX_CEffectGUI, public ModifierKeyProvider + class JuceAAX_GUI : public AAX_CEffectGUI, + public ModifierKeyProvider { public: JuceAAX_GUI() {} diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h index d459326b27..e7e607d90c 100644 --- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h +++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h @@ -693,15 +693,15 @@ public: private: //============================================================================== - class MainContentComponent : public Component, private Value::Listener, - Button::Listener, - ComponentListener + class MainContentComponent : public Component, + private Value::Listener, + private Button::Listener, + private ComponentListener { public: MainContentComponent (StandaloneFilterWindow& filterWindow) : owner (filterWindow), notification (this), - editor (owner.getAudioProcessor()->createEditorIfNeeded()), - shouldShowNotification (false) + editor (owner.getAudioProcessor()->createEditorIfNeeded()) { Value& inputMutedValue = owner.pluginHolder->getMuteInputValue(); @@ -829,7 +829,7 @@ private: StandaloneFilterWindow& owner; NotificationArea notification; ScopedPointer editor; - bool shouldShowNotification; + bool shouldShowNotification = false; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContentComponent) }; diff --git a/modules/juce_audio_utils/players/juce_SoundPlayer.cpp b/modules/juce_audio_utils/players/juce_SoundPlayer.cpp index bf7090bda2..7b8acedb19 100644 --- a/modules/juce_audio_utils/players/juce_SoundPlayer.cpp +++ b/modules/juce_audio_utils/players/juce_SoundPlayer.cpp @@ -49,7 +49,8 @@ private: //============================================================================== // An AudioSourcePlayer which will remove itself from the AudioDeviceManager's // callback list once it finishes playing its source -struct AutoRemovingTransportSource : public AudioTransportSource, private Timer +struct AutoRemovingTransportSource : public AudioTransportSource, + private Timer { AutoRemovingTransportSource (MixerAudioSource& mixerToUse, AudioTransportSource* ts, bool ownSource, int samplesPerBlock, double requiredSampleRate) diff --git a/modules/juce_core/threads/juce_Thread.cpp b/modules/juce_core/threads/juce_Thread.cpp index 0e433e7b6e..07580f73bf 100644 --- a/modules/juce_core/threads/juce_Thread.cpp +++ b/modules/juce_core/threads/juce_Thread.cpp @@ -461,7 +461,8 @@ public: static AtomicTests atomicUnitTests; //============================================================================== -class ThreadLocalValueUnitTest : public UnitTest, private Thread +class ThreadLocalValueUnitTest : public UnitTest, + private Thread { public: ThreadLocalValueUnitTest() diff --git a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp index 22de557db7..c94a55524b 100644 --- a/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp +++ b/modules/juce_gui_basics/filebrowser/juce_FileChooserDialogBox.cpp @@ -61,7 +61,7 @@ public: { const int buttonHeight = 26; - Rectangle area (getLocalBounds()); + auto area = getLocalBounds(); text.createLayout (getLookAndFeel().createFileChooserHeaderText (getName(), instructions), getWidth() - 12.0f); @@ -69,7 +69,7 @@ public: area.removeFromTop (roundToInt (text.getHeight()) + 10); chooserComponent.setBounds (area.removeFromTop (area.getHeight() - buttonHeight - 20)); - Rectangle buttonArea (area.reduced (16, 10)); + auto buttonArea = area.reduced (16, 10); okButton.changeWidthToFitText (buttonHeight); okButton.setBounds (buttonArea.removeFromRight (okButton.getWidth() + 16)); @@ -85,8 +85,6 @@ public: FileBrowserComponent& chooserComponent; TextButton okButton, cancelButton, newFolderButton; - -private: String instructions; TextLayout text; }; @@ -95,10 +93,10 @@ private: FileChooserDialogBox::FileChooserDialogBox (const String& name, const String& instructions, FileBrowserComponent& chooserComponent, - const bool warnAboutOverwritingExistingFiles_, + bool shouldWarn, Colour backgroundColour) : ResizableWindow (name, backgroundColour, true), - warnAboutOverwritingExistingFiles (warnAboutOverwritingExistingFiles_) + warnAboutOverwritingExistingFiles (shouldWarn) { content = new ContentComponent (name, instructions, chooserComponent); setContentOwned (content, false); @@ -149,7 +147,7 @@ void FileChooserDialogBox::centreWithDefaultSize (Component* componentToCentreAr int FileChooserDialogBox::getDefaultWidth() const { - if (Component* const previewComp = content->chooserComponent.getPreviewComponent()) + if (auto* previewComp = content->chooserComponent.getPreviewComponent()) return 400 + previewComp->getWidth(); return 600; @@ -158,18 +156,9 @@ int FileChooserDialogBox::getDefaultWidth() const //============================================================================== void FileChooserDialogBox::buttonClicked (Button* button) { - if (button == &(content->okButton)) - { - okButtonPressed(); - } - else if (button == &(content->cancelButton)) - { - closeButtonPressed(); - } - else if (button == &(content->newFolderButton)) - { - createNewFolder(); - } + if (button == &(content->okButton)) okButtonPressed(); + if (button == &(content->cancelButton)) closeButtonPressed(); + if (button == &(content->newFolderButton)) createNewFolder(); } void FileChooserDialogBox::closeButtonPressed() @@ -235,13 +224,13 @@ void FileChooserDialogBox::createNewFolderCallback (int result, FileChooserDialo void FileChooserDialogBox::createNewFolder() { - File parent (content->chooserComponent.getRoot()); + auto parent = content->chooserComponent.getRoot(); if (parent.isDirectory()) { - AlertWindow* aw = new AlertWindow (TRANS("New Folder"), - TRANS("Please enter the name for the folder"), - AlertWindow::NoIcon, this); + auto* aw = new AlertWindow (TRANS("New Folder"), + TRANS("Please enter the name for the folder"), + AlertWindow::NoIcon, this); aw->addTextEditor ("Folder Name", String(), String(), false); aw->addButton (TRANS("Create Folder"), 1, KeyPress (KeyPress::returnKey)); @@ -256,18 +245,16 @@ void FileChooserDialogBox::createNewFolder() void FileChooserDialogBox::createNewFolderConfirmed (const String& nameFromDialog) { - const String name (File::createLegalFileName (nameFromDialog)); + auto name = File::createLegalFileName (nameFromDialog); if (! name.isEmpty()) { - const File parent (content->chooserComponent.getRoot()); + auto parent = content->chooserComponent.getRoot(); if (! parent.getChildFile (name).createDirectory()) - { AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon, TRANS ("New Folder"), TRANS ("Couldn't create the folder!")); - } content->chooserComponent.refresh(); } diff --git a/modules/juce_gui_basics/native/juce_ios_FileChooser.mm b/modules/juce_gui_basics/native/juce_ios_FileChooser.mm index b52cd4a672..09e09f8e9a 100644 --- a/modules/juce_gui_basics/native/juce_ios_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_ios_FileChooser.mm @@ -31,7 +31,8 @@ namespace juce template <> struct ContainerDeletePolicy { static void destroy (NSObject* o) { [o release]; } }; template <> struct ContainerDeletePolicy> { static void destroy (NSObject* o) { [o release]; } }; -class FileChooser::Native : private Component, public FileChooser::Pimpl +class FileChooser::Native : private Component, + public FileChooser::Pimpl { public: Native (FileChooser& fileChooser, int flags) @@ -50,8 +51,8 @@ public: auto currentFileOrDirectory = owner.startingFile; UIDocumentPickerMode pickerMode = currentFileOrDirectory.existsAsFile() - ? UIDocumentPickerModeExportToService - : UIDocumentPickerModeMoveToService; + ? UIDocumentPickerModeExportToService + : UIDocumentPickerModeMoveToService; if (! currentFileOrDirectory.existsAsFile()) { diff --git a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm index 55ec816a4b..0bb954c050 100644 --- a/modules/juce_gui_basics/native/juce_mac_FileChooser.mm +++ b/modules/juce_gui_basics/native/juce_mac_FileChooser.mm @@ -51,7 +51,8 @@ static NSMutableArray* createAllowedTypesArray (const StringArray& filters) //============================================================================== template <> struct ContainerDeletePolicy { static void destroy (NSObject* o) { [o release]; } }; -class FileChooser::Native : public Component, public FileChooser::Pimpl +class FileChooser::Native : public Component, + public FileChooser::Pimpl { public: Native (FileChooser& fileChooser, int flags, FilePreviewComponent* previewComponent) diff --git a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp index 52c2a2400f..b20781e0f4 100644 --- a/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp +++ b/modules/juce_gui_basics/native/juce_win32_FileChooser.cpp @@ -35,7 +35,8 @@ namespace juce // not have been created yet when the user deletes JUCE's FileChooser class. If this // occurs the Win32NativeFileChooser will still have a reference count of 1 and will // simply delete itself immedietely once the HWND will have been created a while later. -class Win32NativeFileChooser : public ReferenceCountedObject, private Thread +class Win32NativeFileChooser : public ReferenceCountedObject, + private Thread { public: typedef ReferenceCountedObjectPtr Ptr; @@ -500,7 +501,8 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Win32NativeFileChooser) }; -class FileChooser::Native : public Component, public FileChooser::Pimpl +class FileChooser::Native : public Component, + public FileChooser::Pimpl { public: @@ -509,7 +511,7 @@ public: nativeFileChooser (new Win32NativeFileChooser (this, flags, previewComp, fileChooser.startingFile, fileChooser.title, fileChooser.filters)) { - const Rectangle mainMon (Desktop::getInstance().getDisplays().getMainDisplay().userArea); + auto mainMon = Desktop::getInstance().getDisplays().getMainDisplay().userArea; setBounds (mainMon.getX() + mainMon.getWidth() / 4, mainMon.getY() + mainMon.getHeight() / 4, @@ -531,12 +533,21 @@ public: { SafePointer safeThis (this); +<<<<<<< Updated upstream enterModalState (true, ModalCallbackFunction::create( [safeThis] (int) { if (safeThis != nullptr) safeThis->owner.finished (safeThis->nativeFileChooser->results); })); +======= + enterModalState (true, ModalCallbackFunction::create ( + [safeThis] (int) + { + if (safeThis != nullptr) + safeThis->owner.finished (safeThis->nativeFileChooser->results, true); + })); +>>>>>>> Stashed changes nativeFileChooser->open (true); } diff --git a/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp index 56348bfca3..edeb9dd33b 100644 --- a/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_linux_X11_WebBrowserComponent.cpp @@ -419,7 +419,8 @@ private: }; //============================================================================== -class WebBrowserComponent::Pimpl : private Thread, private CommandReceiver::Responder +class WebBrowserComponent::Pimpl : private Thread, + private CommandReceiver::Responder { public: Pimpl (WebBrowserComponent& parent) diff --git a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp index 9a60047c95..aceeb8dafa 100644 --- a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp +++ b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp @@ -27,7 +27,8 @@ namespace juce { -struct Spinner : public Component, private Timer +struct Spinner : public Component, + private Timer { Spinner() { startTimer (1000 / 50); } void timerCallback() override { repaint(); }