From 3e628c816ef4c66e2005fba879569e36ab573317 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 8 May 2013 11:10:11 +0100 Subject: [PATCH] Minor fixes for clang. --- .../Source/Application/jucer_CommandIDs.h | 1 + .../Source/Application/jucer_JuceUpdater.cpp | 108 +++++++++--------- .../jucer_ColourPropertyComponent.h | 9 +- .../native/juce_osx_MessageQueue.h | 1 - 4 files changed, 59 insertions(+), 60 deletions(-) diff --git a/extras/Introjucer/Source/Application/jucer_CommandIDs.h b/extras/Introjucer/Source/Application/jucer_CommandIDs.h index e6e540143f..b2c81a6a1c 100644 --- a/extras/Introjucer/Source/Application/jucer_CommandIDs.h +++ b/extras/Introjucer/Source/Application/jucer_CommandIDs.h @@ -47,6 +47,7 @@ namespace CommandIDs showAppearanceSettings = 0x200077, showConfigPanel = 0x200074, showFilePanel = 0x200078, + showTranslationTool = 0x200079, closeWindow = 0x201001, closeAllDocuments = 0x201000, diff --git a/extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp b/extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp index a5df9ace8b..174d3c6126 100644 --- a/extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp +++ b/extras/Introjucer/Source/Application/jucer_JuceUpdater.cpp @@ -250,75 +250,75 @@ void JuceUpdater::paintListBoxItem (int /*rowNumber*/, Graphics& g, int /*width* g.fillAll (findColour (TextEditor::highlightColourId)); } -Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool /*isRowSelected*/, Component* existingComponentToUpdate) +class UpdateListComponent : public Component { - class UpdateListComponent : public Component +public: + UpdateListComponent() { - public: - UpdateListComponent() - { - addChildComponent (&toggle); - toggle.setWantsKeyboardFocus (false); - setInterceptsMouseClicks (false, true); - } + addChildComponent (&toggle); + toggle.setWantsKeyboardFocus (false); + setInterceptsMouseClicks (false, true); + } - void setModule (const ModuleList::Module* newModule, - const ModuleList::Module* existingModule, - const Value& value) + void setModule (const ModuleList::Module* newModule, + const ModuleList::Module* existingModule, + const Value& value) + { + if (newModule != nullptr) { - if (newModule != nullptr) + toggle.getToggleStateValue().referTo (value); + toggle.setVisible (true); + toggle.setEnabled (true); + + name = newModule->uid; + status = String::empty; + + if (existingModule == nullptr) { - toggle.getToggleStateValue().referTo (value); - toggle.setVisible (true); - toggle.setEnabled (true); - - name = newModule->uid; - status = String::empty; - - if (existingModule == nullptr) - { - status << " (not currently installed)"; - } - else if (existingModule->version != newModule->version) - { - status << " installed: " << existingModule->version - << ", available: " << newModule->version; - } - else - { - status << " (latest version already installed: " << existingModule->version << ")"; - toggle.setEnabled (false); - } + status << " (not currently installed)"; + } + else if (existingModule->version != newModule->version) + { + status << " installed: " << existingModule->version + << ", available: " << newModule->version; } else { - name = status = String::empty; - toggle.setVisible (false); + status << " (latest version already installed: " << existingModule->version << ")"; + toggle.setEnabled (false); } } - - void paint (Graphics& g) + else { - g.setColour (Colours::black); - g.setFont (getHeight() * 0.7f); - - g.drawText (name, toggle.getRight() + 4, 0, getWidth() / 2 - toggle.getRight() - 4, getHeight(), - Justification::centredLeft, true); - - g.drawText (status, getWidth() / 2, 0, getWidth() / 2, getHeight(), - Justification::centredLeft, true); + name = status = String::empty; + toggle.setVisible (false); } + } - void resized() - { - toggle.setBounds (2, 2, getHeight() - 4, getHeight() - 4); - } + void paint (Graphics& g) + { + g.setColour (Colours::black); + g.setFont (getHeight() * 0.7f); - private: - ToggleButton toggle; - String name, status; - }; + g.drawText (name, toggle.getRight() + 4, 0, getWidth() / 2 - toggle.getRight() - 4, getHeight(), + Justification::centredLeft, true); + g.drawText (status, getWidth() / 2, 0, getWidth() / 2, getHeight(), + Justification::centredLeft, true); + } + + void resized() + { + toggle.setBounds (2, 2, getHeight() - 4, getHeight() - 4); + } + +private: + ToggleButton toggle; + String name, status; +}; + +Component* JuceUpdater::refreshComponentForRow (int rowNumber, bool /*isRowSelected*/, Component* existingComponentToUpdate) +{ UpdateListComponent* c = dynamic_cast (existingComponentToUpdate); if (c == nullptr) c = new UpdateListComponent(); diff --git a/extras/Introjucer/Source/ComponentEditor/properties/jucer_ColourPropertyComponent.h b/extras/Introjucer/Source/ComponentEditor/properties/jucer_ColourPropertyComponent.h index 263cdec695..1057686122 100644 --- a/extras/Introjucer/Source/ComponentEditor/properties/jucer_ColourPropertyComponent.h +++ b/extras/Introjucer/Source/ComponentEditor/properties/jucer_ColourPropertyComponent.h @@ -49,7 +49,6 @@ public: ((ColourPropEditorComponent*) getChildComponent (0))->refresh(); } -private: class ColourEditorComponent : public Component, public ChangeListener { @@ -107,10 +106,6 @@ private: setColour (cs->getCurrentColour()); } - private: - Colour colour; - bool canResetToDefault; - class ColourSelectorComp : public Component, public ButtonListener { @@ -181,6 +176,10 @@ private: ColourSelectorWithSwatches selector; TextButton defaultButton; }; + + private: + Colour colour; + bool canResetToDefault; }; class ColourPropEditorComponent : public ColourEditorComponent diff --git a/modules/juce_events/native/juce_osx_MessageQueue.h b/modules/juce_events/native/juce_osx_MessageQueue.h index 5ca6caf764..6e7a3339d6 100644 --- a/modules/juce_events/native/juce_osx_MessageQueue.h +++ b/modules/juce_events/native/juce_osx_MessageQueue.h @@ -63,7 +63,6 @@ public: private: ReferenceCountedArray messages; - CriticalSection lock; CFRunLoopRef runLoop; CFRunLoopSourceRef runLoopSource;