diff options
author | David Robillard <d@drobilla.net> | 2010-02-23 18:45:26 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-23 18:45:26 +0000 |
commit | 784dc03a78dc338b45111ebdca45371dfaaa6fa9 (patch) | |
tree | f4ff924374bb05fb6ef6c824ca3b61135956c9ec /src/gui | |
parent | ca809494991686b253679ecf0c0b8b4bf48aa22d (diff) | |
download | ingen-784dc03a78dc338b45111ebdca45371dfaaa6fa9.tar.gz ingen-784dc03a78dc338b45111ebdca45371dfaaa6fa9.tar.bz2 ingen-784dc03a78dc338b45111ebdca45371dfaaa6fa9.zip |
Fix various code issues discovered by cppcheck.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2484 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/App.cpp | 3 | ||||
-rw-r--r-- | src/gui/NodeMenu.cpp | 4 | ||||
-rw-r--r-- | src/gui/NodeMenu.hpp | 4 | ||||
-rw-r--r-- | src/gui/NodeModule.cpp | 6 | ||||
-rw-r--r-- | src/gui/PatchTreeWindow.hpp | 3 | ||||
-rw-r--r-- | src/gui/PortPropertiesWindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/PortPropertiesWindow.hpp | 2 |
7 files changed, 12 insertions, 18 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp index c2cde0ed..3bf45761 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -99,8 +99,11 @@ App::App(Ingen::Shared::World* world) App::~App() { + delete _configuration; + delete _window_factory; } + void App::init(Ingen::Shared::World* world) { diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index aed7650c..be5d645b 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -170,7 +170,7 @@ NodeMenu::on_menu_disconnect() void -NodeMenu::on_preset_activated(const std::string uri) +NodeMenu::on_preset_activated(const std::string& uri) { #ifdef HAVE_SLV2 const NodeModel* const node = (NodeModel*)_object.get(); @@ -197,7 +197,7 @@ NodeMenu::on_preset_activated(const std::string uri) bool -NodeMenu::on_preset_clicked(const std::string uri, GdkEventButton* ev) +NodeMenu::on_preset_clicked(const std::string& uri, GdkEventButton* ev) { on_preset_activated(uri); return false; diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp index 1698e597..8a92c6b5 100644 --- a/src/gui/NodeMenu.hpp +++ b/src/gui/NodeMenu.hpp @@ -53,8 +53,8 @@ protected: void on_menu_disconnect(); void on_menu_embed_gui(); void on_menu_randomize(); - void on_preset_activated(const std::string uri); - bool on_preset_clicked(const std::string uri, GdkEventButton* ev); + void on_preset_activated(const std::string& uri); + bool on_preset_clicked(const std::string& uri, GdkEventButton* ev); Gtk::MenuItem* _controls_menuitem; Gtk::MenuItem* _popup_gui_menuitem; diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 68f66c70..03182942 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -66,11 +66,7 @@ NodeModule::NodeModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeMode NodeModule::~NodeModule() { NodeControlWindow* win = App::instance().window_factory()->control_window(_node); - - if (win) { - // Should remove from window factory via signal - delete win; - } + delete win; // Will be removed from window factory via signal } diff --git a/src/gui/PatchTreeWindow.hpp b/src/gui/PatchTreeWindow.hpp index b4f6ec2f..d3286653 100644 --- a/src/gui/PatchTreeWindow.hpp +++ b/src/gui/PatchTreeWindow.hpp @@ -88,7 +88,8 @@ class PatchTreeView : public Gtk::TreeView { public: PatchTreeView(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) - : Gtk::TreeView(cobject) + : Gtk::TreeView(cobject) + , _window(NULL) {} void set_window(PatchTreeWindow* win) { _window = win; } diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp index 7dd5efe2..c4ffc222 100644 --- a/src/gui/PortPropertiesWindow.cpp +++ b/src/gui/PortPropertiesWindow.cpp @@ -35,7 +35,8 @@ namespace GUI { PortPropertiesWindow::PortPropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) : Window(cobject) - //, _enable_signal(false) + , _initial_min(0.0f) + , _initial_max(1.0f) { xml->get_widget("port_properties_min_spinner", _min_spinner); xml->get_widget("port_properties_max_spinner", _max_spinner); @@ -86,8 +87,6 @@ PortPropertiesWindow::present(SharedPtr<PortModel> pm) _connections.push_back(pm->signal_property.connect( sigc::mem_fun(this, &PortPropertiesWindow::property_changed))); - //_enable_signal = true; - Gtk::Window::present(); } @@ -96,7 +95,6 @@ void PortPropertiesWindow::property_changed(const URI& key, const Atom& value) { const Shared::LV2URIMap& uris = App::instance().uris(); - //_enable_signal = false; if (value.type() == Atom::FLOAT) { if (key == uris.lv2_minimum) @@ -104,8 +102,6 @@ PortPropertiesWindow::property_changed(const URI& key, const Atom& value) else if (key == uris.lv2_maximum) _max_spinner->set_value(value.get_float()); } - - //_enable_signal = true; } diff --git a/src/gui/PortPropertiesWindow.hpp b/src/gui/PortPropertiesWindow.hpp index 2e14976f..ce52cb8e 100644 --- a/src/gui/PortPropertiesWindow.hpp +++ b/src/gui/PortPropertiesWindow.hpp @@ -49,8 +49,6 @@ private: void ok(); void cancel(); - //bool _enable_signal; - float _initial_min; float _initial_max; |