summaryrefslogtreecommitdiffstats
path: root/src/PatchageEvent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/PatchageEvent.cpp')
-rw-r--r--src/PatchageEvent.cpp14
1 files changed, 8 insertions, 6 deletions
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);
+ }
}
}