summaryrefslogtreecommitdiffstats
path: root/src/gui/GraphCanvas.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-12-25 15:26:48 -0500
committerDavid Robillard <d@drobilla.net>2017-12-25 16:26:13 -0500
commit15b3b0e9f8823752f80c7e597a70749813e61c79 (patch)
tree3f324c6e2a455be8b929456dadbf06520889d435 /src/gui/GraphCanvas.cpp
parentd6a9571641bcb34acb3521feb08eea33195fd9ca (diff)
downloadingen-15b3b0e9f8823752f80c7e597a70749813e61c79.tar.gz
ingen-15b3b0e9f8823752f80c7e597a70749813e61c79.tar.bz2
ingen-15b3b0e9f8823752f80c7e597a70749813e61c79.zip
Always use braces
Diffstat (limited to 'src/gui/GraphCanvas.cpp')
-rw-r--r--src/gui/GraphCanvas.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 8becdb48..ebb357cf 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -181,13 +181,15 @@ GraphCanvas::show_menu(bool position, unsigned button, uint32_t time)
{
_app.request_plugins_if_necessary();
- if (!_internal_menu || _menu_dirty)
+ if (!_internal_menu || _menu_dirty) {
build_menus();
+ }
- if (position)
+ if (position) {
_menu->popup(sigc::mem_fun(this, &GraphCanvas::auto_menu_position), button, time);
- else
+ } else {
_menu->popup(button, time);
+ }
}
void
@@ -240,8 +242,9 @@ GraphCanvas::build()
// Create modules for blocks
for (Store::const_iterator i = kids.first; i != kids.second; ++i) {
SPtr<BlockModel> block = dynamic_ptr_cast<BlockModel>(i->second);
- if (block && block->parent() == _graph)
+ if (block && block->parent() == _graph) {
add_block(block);
+ }
}
// Create pseudo modules for ports (ports on this canvas, not on our module)
@@ -262,12 +265,14 @@ show_module_human_names(GanvNode* node, void* data)
if (GANV_IS_MODULE(node)) {
Ganv::Module* module = Glib::wrap(GANV_MODULE(node));
NodeModule* nmod = dynamic_cast<NodeModule*>(module);
- if (nmod)
+ if (nmod) {
nmod->show_human_names(b);
+ }
GraphPortModule* pmod = dynamic_cast<GraphPortModule*>(module);
- if (pmod)
+ if (pmod) {
pmod->show_human_names(b);
+ }
}
}
@@ -396,8 +401,9 @@ GraphCanvas::get_port_view(SPtr<PortModel> port)
if (module) {
for (const auto& p : *module) {
GUI::Port* pv = dynamic_cast<GUI::Port*>(p);
- if (pv && pv->model() == port)
+ if (pv && pv->model() == port) {
return pv;
+ }
}
}
}
@@ -776,8 +782,9 @@ GraphCanvas::generate_port_name(
snprintf(num_buf, sizeof(num_buf), "%u", i);
symbol = sym_base + "_";
symbol += num_buf;
- if (!_graph->get_port(Raul::Symbol::symbolify(symbol)))
+ if (!_graph->get_port(Raul::Symbol::symbolify(symbol))) {
break;
+ }
}
assert(Raul::Path::is_valid(string("/") + symbol));
@@ -816,8 +823,9 @@ void
GraphCanvas::load_plugin(WPtr<PluginModel> weak_plugin)
{
SPtr<PluginModel> plugin = weak_plugin.lock();
- if (!plugin)
+ if (!plugin) {
return;
+ }
Raul::Symbol symbol = plugin->default_block_symbol();
unsigned offset = _app.store()->child_name_offset(_graph->path(), symbol);