summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeModule.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-14 20:52:20 +0100
committerDavid Robillard <d@drobilla.net>2020-12-14 22:04:29 +0100
commitc8cb65e56c3abca075f47b0a1efc509ad2d26c28 (patch)
treed0a6dc719c38a8203cabf5ffc9262dcafe1ca09a /src/gui/NodeModule.cpp
parent1d3af34bd3ab9b55cdb610922aac39e62fdb13a9 (diff)
downloadingen-c8cb65e56c3abca075f47b0a1efc509ad2d26c28.tar.gz
ingen-c8cb65e56c3abca075f47b0a1efc509ad2d26c28.tar.bz2
ingen-c8cb65e56c3abca075f47b0a1efc509ad2d26c28.zip
Use range-based loops for module ports
Diffstat (limited to 'src/gui/NodeModule.cpp')
-rw-r--r--src/gui/NodeModule.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 1b18958f..902df4ec 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -181,8 +181,8 @@ NodeModule::show_human_names(bool b)
set_label(block()->symbol().c_str());
}
- for (iterator i = begin(); i != end(); ++i) {
- auto* const port = dynamic_cast<ingen::gui::Port*>(*i);
+ for (auto* p : *this) {
+ auto* const port = dynamic_cast<ingen::gui::Port*>(p);
Glib::ustring label(port->model()->symbol().c_str());
if (b) {
const Atom& name_property = port->model()->get_property(uris.lv2_name);
@@ -196,7 +196,7 @@ NodeModule::show_human_names(bool b)
}
}
}
- (*i)->set_label(label.c_str());
+ port->set_label(label.c_str());
}
}
@@ -238,8 +238,8 @@ NodeModule::port_value_changed(uint32_t index, const Atom& value)
void
NodeModule::plugin_changed()
{
- for (iterator p = begin(); p != end(); ++p) {
- dynamic_cast<ingen::gui::Port*>(*p)->update_metadata();
+ for (auto* p : *this) {
+ dynamic_cast<ingen::gui::Port*>(p)->update_metadata();
}
}
@@ -324,8 +324,8 @@ NodeModule::new_port_view(std::shared_ptr<const PortModel> port)
Port*
NodeModule::port(std::shared_ptr<const PortModel> model)
{
- for (iterator p = begin(); p != end(); ++p) {
- Port* const port = dynamic_cast<Port*>(*p);
+ for (auto* p : *this) {
+ auto* const port = dynamic_cast<Port*>(p);
if (port->model() == model) {
return port;
}