summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-05-23 03:26:56 +0000
committerDavid Robillard <d@drobilla.net>2008-05-23 03:26:56 +0000
commit8fd14150f5db68e3cdd1978ecf6a3607d112c93d (patch)
tree68dab501a5921d1328a3540d092c1f0db41de513 /src/libs/engine/events
parentdfc9f577630309a56a786c78da0bde705a0b2135 (diff)
downloadingen-8fd14150f5db68e3cdd1978ecf6a3607d112c93d.tar.gz
ingen-8fd14150f5db68e3cdd1978ecf6a3607d112c93d.tar.bz2
ingen-8fd14150f5db68e3cdd1978ecf6a3607d112c93d.zip
Fix false "unable to find object to destroy" error message.
Nicer error messages for missing plugins. git-svn-id: http://svn.drobilla.net/lad/ingen@1225 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/CreateNodeEvent.cpp8
-rw-r--r--src/libs/engine/events/DestroyEvent.cpp34
2 files changed, 22 insertions, 20 deletions
diff --git a/src/libs/engine/events/CreateNodeEvent.cpp b/src/libs/engine/events/CreateNodeEvent.cpp
index ab9c6eaf..9a882209 100644
--- a/src/libs/engine/events/CreateNodeEvent.cpp
+++ b/src/libs/engine/events/CreateNodeEvent.cpp
@@ -135,8 +135,12 @@ CreateNodeEvent::post_process()
_responder->respond_error(msg);
} else if (_node == NULL) {
msg = "Unable to load node ";
- msg.append(_path).append(" (you're missing the plugin \"").append(
- _plugin_uri);
+ msg += _path + " (you're missing the plugin ";
+ if (_plugin_uri != "")
+ msg += _plugin_uri;
+ else
+ msg += _plugin_lib + ":" + _plugin_label + " (" + _plugin_type + ")";
+ msg += ")";
_responder->respond_error(msg);
} else {
_responder->respond_ok();
diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp
index 4f2cba3f..9a235807 100644
--- a/src/libs/engine/events/DestroyEvent.cpp
+++ b/src/libs/engine/events/DestroyEvent.cpp
@@ -36,16 +36,16 @@ namespace Ingen {
DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const string& path, bool block)
-: QueuedEvent(engine, responder, time, source, source),
- _path(path),
- _store_iterator(engine.object_store()->objects().end()),
- _driver_port(NULL),
- _patch_node_listnode(NULL),
- _patch_port_listnode(NULL),
- _ports_array(NULL),
- _compiled_patch(NULL),
- _disconnect_node_event(NULL),
- _disconnect_port_event(NULL)
+ : QueuedEvent(engine, responder, time, source, source)
+ , _path(path)
+ , _store_iterator(engine.object_store()->objects().end())
+ , _driver_port(NULL)
+ , _patch_node_listnode(NULL)
+ , _patch_port_listnode(NULL)
+ , _ports_array(NULL)
+ , _compiled_patch(NULL)
+ , _disconnect_node_event(NULL)
+ , _disconnect_port_event(NULL)
{
assert(_source);
}
@@ -167,13 +167,15 @@ DestroyEvent::execute(ProcessContext& context)
void
DestroyEvent::post_process()
{
- if (_store_iterator != _engine.object_store()->objects().end()) {
+ if (_node || _port) {
_engine.broadcaster()->send_destroyed(_path);
} else {
- if (_path == "/")
+ if (_path == "/") {
_responder->respond_error("You can not destroy the root patch (/)");
- else
- _responder->respond_error("Could not find object to destroy");
+ } else {
+ string msg = string("Could not find object ") + _path + " to destroy";
+ _responder->respond_error(msg);
+ }
}
if (_patch_node_listnode) {
@@ -184,8 +186,6 @@ DestroyEvent::post_process()
_disconnect_node_event->post_process();
_engine.broadcaster()->send_destroyed(_path);
_engine.maid()->push(_patch_node_listnode);
- //_engine.maid()->push(_node);
- _node.reset();
} else if (_patch_port_listnode) {
assert(_port);
_responder->respond_ok();
@@ -193,8 +193,6 @@ DestroyEvent::post_process()
_disconnect_port_event->post_process();
_engine.broadcaster()->send_destroyed(_path);
_engine.maid()->push(_patch_port_listnode);
- //_engine.maid()->push(_port);
- _port.reset();
} else {
_responder->respond_error("Unable to destroy object");
}