From 6342c9cfa934b356b6903be030ce2667c4e5b829 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 27 Nov 2020 17:57:39 +0100 Subject: Always use braces around statements --- src/PatchageEvent.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/PatchageEvent.cpp') diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp index a1b3f0a..3c6806f 100644 --- a/src/PatchageEvent.cpp +++ b/src/PatchageEvent.cpp @@ -86,31 +86,33 @@ PatchageEvent::execute(Patchage* patchage) PatchagePort* port_1 = patchage->canvas()->find_port(_port_1); PatchagePort* port_2 = patchage->canvas()->find_port(_port_2); - if (!port_1) + if (!port_1) { patchage->error_msg( (format("Unable to find port `%1%' to connect") % _port_1) .str()); - else if (!port_2) + } else if (!port_2) { patchage->error_msg( (format("Unable to find port `%1%' to connect") % _port_2) .str()); - else + } else { patchage->canvas()->make_connection(port_1, port_2); + } } else if (_type == DISCONNECTION) { PatchagePort* port_1 = patchage->canvas()->find_port(_port_1); PatchagePort* port_2 = patchage->canvas()->find_port(_port_2); - if (!port_1) + if (!port_1) { patchage->error_msg( (format("Unable to find port `%1%' to disconnect") % _port_1) .str()); - else if (!port_2) + } else if (!port_2) { patchage->error_msg( (format("Unable to find port `%1%' to disconnect") % _port_2) .str()); - else + } else { patchage->canvas()->remove_edge_between(port_1, port_2); + } } } -- cgit v1.2.1