diff options
author | David Robillard <d@drobilla.net> | 2006-06-14 04:55:18 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-06-14 04:55:18 +0000 |
commit | 52f5c887cf8d4149278d137684f8f1ee31231d65 (patch) | |
tree | bec3035a45debe8ba98502b854133647154cb6f2 /src/libs/client/Store.cpp | |
parent | 7ed3ef703ba8e0aa2c228e21d798d906194f6915 (diff) | |
download | ingen-52f5c887cf8d4149278d137684f8f1ee31231d65.tar.gz ingen-52f5c887cf8d4149278d137684f8f1ee31231d65.tar.bz2 ingen-52f5c887cf8d4149278d137684f8f1ee31231d65.zip |
Node destruction working
git-svn-id: http://svn.drobilla.net/lad/grauph@36 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/Store.cpp')
-rw-r--r-- | src/libs/client/Store.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index 56c6654f..d1555f4d 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -164,7 +164,31 @@ Store::add_plugin(CountedPtr<PluginModel> pm) void Store::destruction_event(const string& path) { - remove_object(path); + // I'm assuming the compiler will optimize out all these const + // pointers into one... + + CountedPtr<ObjectModel> obj_ptr = remove_object(path); + ObjectModel* const object = obj_ptr.get(); + + // FIXME: Why does this need to be specific? Just make a remove_child + // for everything + + // Succeeds for (Plugin) Nodes and Patches + NodeModel* const node = dynamic_cast<NodeModel*>(object); + if (node) { + cerr << "Node\n"; + PatchModel* const parent = dynamic_cast<PatchModel* const>(object->parent().get()); + if (parent) + parent->remove_node(node->name()); + } + + PortModel* const port = dynamic_cast<PortModel*>(object); + if (port) { + NodeModel* const parent = dynamic_cast<NodeModel* const>(object->parent().get()); + assert(parent); + parent->remove_port(port->name()); + } + // FIXME: emit signals } |