From 4e754a838b81660691b25904d306279609c2f5cc Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 23 May 2012 21:31:44 +0100 Subject: [PATCH] Changed the constness of the return type of MenuBarModel::getMenuBarNames() and MenuBarModel::getMenuForIndex(). Easy to update your code to handle this, just remove the 'const'. --- extras/Introjucer/Source/Application/jucer_Application.h | 4 ++-- extras/JuceDemo/Source/MainDemoWindow.cpp | 4 ++-- extras/audio plugin host/Source/MainHostWindow.cpp | 4 ++-- extras/audio plugin host/Source/MainHostWindow.h | 4 ++-- .../src/model/components/jucer_JucerComponentHandler.h | 2 +- .../src/model/components/jucer_TabbedComponentHandler.h | 2 +- .../src/model/components/jucer_ViewportHandler.h | 5 ++--- .../src/properties/jucer_FilePropertyComponent.h | 8 ++++---- extras/the jucer/src/ui/jucer_MainWindow.cpp | 6 +++--- modules/juce_gui_basics/menus/juce_MenuBarModel.h | 6 +++--- 10 files changed, 22 insertions(+), 23 deletions(-) diff --git a/extras/Introjucer/Source/Application/jucer_Application.h b/extras/Introjucer/Source/Application/jucer_Application.h index bc430231cf..1fc8e2e576 100644 --- a/extras/Introjucer/Source/Application/jucer_Application.h +++ b/extras/Introjucer/Source/Application/jucer_Application.h @@ -174,13 +174,13 @@ public: setApplicationCommandManagerToWatch (commandManager); } - const StringArray getMenuBarNames() + StringArray getMenuBarNames() { const char* const names[] = { "File", "Edit", "View", "Window", "Tools", 0 }; return StringArray ((const char**) names); } - const PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/) + PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/) { PopupMenu menu; diff --git a/extras/JuceDemo/Source/MainDemoWindow.cpp b/extras/JuceDemo/Source/MainDemoWindow.cpp index e020b74207..e638215ed0 100644 --- a/extras/JuceDemo/Source/MainDemoWindow.cpp +++ b/extras/JuceDemo/Source/MainDemoWindow.cpp @@ -64,14 +64,14 @@ public: } //============================================================================== - const StringArray getMenuBarNames() + StringArray getMenuBarNames() { const char* const names[] = { "Demo", "Look-and-feel", nullptr }; return StringArray (names); } - const PopupMenu getMenuForIndex (int menuIndex, const String& /*menuName*/) + PopupMenu getMenuForIndex (int menuIndex, const String& /*menuName*/) { ApplicationCommandManager* commandManager = &(mainWindow.commandManager); diff --git a/extras/audio plugin host/Source/MainHostWindow.cpp b/extras/audio plugin host/Source/MainHostWindow.cpp index bc8324b4a5..05859c29f9 100644 --- a/extras/audio plugin host/Source/MainHostWindow.cpp +++ b/extras/audio plugin host/Source/MainHostWindow.cpp @@ -164,14 +164,14 @@ void MainHostWindow::changeListenerCallback (ChangeBroadcaster*) } } -const StringArray MainHostWindow::getMenuBarNames() +StringArray MainHostWindow::getMenuBarNames() { const char* const names[] = { "File", "Plugins", "Options", nullptr }; return StringArray (names); } -const PopupMenu MainHostWindow::getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/) +PopupMenu MainHostWindow::getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/) { PopupMenu menu; diff --git a/extras/audio plugin host/Source/MainHostWindow.h b/extras/audio plugin host/Source/MainHostWindow.h index 9d9f0fb48b..5a643fa9ce 100644 --- a/extras/audio plugin host/Source/MainHostWindow.h +++ b/extras/audio plugin host/Source/MainHostWindow.h @@ -68,8 +68,8 @@ public: void fileDragExit (const StringArray& files); void filesDropped (const StringArray& files, int, int); - const StringArray getMenuBarNames(); - const PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName); + StringArray getMenuBarNames(); + PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& menuName); void menuItemSelected (int menuItemID, int topLevelMenuIndex); ApplicationCommandTarget* getNextCommandTarget(); void getAllCommands (Array & commands); diff --git a/extras/the jucer/src/model/components/jucer_JucerComponentHandler.h b/extras/the jucer/src/model/components/jucer_JucerComponentHandler.h index 8a99f0ed1e..71c844f510 100644 --- a/extras/the jucer/src/model/components/jucer_JucerComponentHandler.h +++ b/extras/the jucer/src/model/components/jucer_JucerComponentHandler.h @@ -183,7 +183,7 @@ private: .replaceCharacter ('\\', '/')); } - const File getFile() const + File getFile() const { return component->findFile(); } diff --git a/extras/the jucer/src/model/components/jucer_TabbedComponentHandler.h b/extras/the jucer/src/model/components/jucer_TabbedComponentHandler.h index d3f809bd4b..de93d6b56e 100644 --- a/extras/the jucer/src/model/components/jucer_TabbedComponentHandler.h +++ b/extras/the jucer/src/model/components/jucer_TabbedComponentHandler.h @@ -987,7 +987,7 @@ private: "Change tab component file"); } - const File getFile() const + File getFile() const { return document.getFile().getSiblingFile (getTabJucerFile (component, tabIndex)); } diff --git a/extras/the jucer/src/model/components/jucer_ViewportHandler.h b/extras/the jucer/src/model/components/jucer_ViewportHandler.h index 13ae1cdf76..01e26808af 100644 --- a/extras/the jucer/src/model/components/jucer_ViewportHandler.h +++ b/extras/the jucer/src/model/components/jucer_ViewportHandler.h @@ -507,12 +507,11 @@ private: { document.perform (new JucerCompFileChangeAction (component, *document.getComponentLayout(), newFile.getRelativePathFrom (document.getFile().getParentDirectory()) - .replaceCharacter ('\\', '/') -), + .replaceCharacter ('\\', '/')), "Change Jucer component file"); } - const File getFile() const + File getFile() const { const String filename (getViewportJucerComponentFile (component)); diff --git a/extras/the jucer/src/properties/jucer_FilePropertyComponent.h b/extras/the jucer/src/properties/jucer_FilePropertyComponent.h index 379eba8e1b..ef8073e8fb 100644 --- a/extras/the jucer/src/properties/jucer_FilePropertyComponent.h +++ b/extras/the jucer/src/properties/jucer_FilePropertyComponent.h @@ -36,16 +36,16 @@ class FilePropertyComponent : public PropertyComponent, public: //============================================================================== FilePropertyComponent (const String& name, - const bool isDirectory, - const bool allowEditingOfFilename, - const String& fileBrowserWildcard = "*"); + const bool isDirectory, + const bool allowEditingOfFilename, + const String& fileBrowserWildcard = "*"); ~FilePropertyComponent(); //============================================================================== virtual void setFile (const File& newFile) = 0; - virtual const File getFile() const = 0; + virtual File getFile() const = 0; //============================================================================== void refresh(); diff --git a/extras/the jucer/src/ui/jucer_MainWindow.cpp b/extras/the jucer/src/ui/jucer_MainWindow.cpp index 9c1f751f10..01864b0839 100644 --- a/extras/the jucer/src/ui/jucer_MainWindow.cpp +++ b/extras/the jucer/src/ui/jucer_MainWindow.cpp @@ -223,15 +223,15 @@ void MainWindow::activeWindowStatusChanged() } //============================================================================== -const StringArray MainWindow::getMenuBarNames() +StringArray MainWindow::getMenuBarNames() { const char* const names[] = { "File", "Edit", "View", 0 }; return StringArray (names); } -const PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex, - const String& menuName) +PopupMenu MainWindow::getMenuForIndex (int topLevelMenuIndex, + const String& menuName) { PopupMenu menu; diff --git a/modules/juce_gui_basics/menus/juce_MenuBarModel.h b/modules/juce_gui_basics/menus/juce_MenuBarModel.h index 4600ca261c..02e0872c4a 100644 --- a/modules/juce_gui_basics/menus/juce_MenuBarModel.h +++ b/modules/juce_gui_basics/menus/juce_MenuBarModel.h @@ -111,15 +111,15 @@ public: //============================================================================== /** This method must return a list of the names of the menus. */ - virtual const StringArray getMenuBarNames() = 0; + virtual StringArray getMenuBarNames() = 0; /** This should return the popup menu to display for a given top-level menu. @param topLevelMenuIndex the index of the top-level menu to show @param menuName the name of the top-level menu item to show */ - virtual const PopupMenu getMenuForIndex (int topLevelMenuIndex, - const String& menuName) = 0; + virtual PopupMenu getMenuForIndex (int topLevelMenuIndex, + const String& menuName) = 0; /** This is called when a menu item has been clicked on.