summaryrefslogtreecommitdiffstats
path: root/src/server/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-24 04:47:33 +0000
committerDavid Robillard <d@drobilla.net>2014-01-24 04:47:33 +0000
commit2c03f2abd3d3d98a81020438ca805acded39dbab (patch)
tree92abb5ae29cbc25a0655e7aa5b6a8c07bbff6756 /src/server/events
parentd970641441746aacfc645176b71d7ba71af0463a (diff)
downloadingen-2c03f2abd3d3d98a81020438ca805acded39dbab.tar.gz
ingen-2c03f2abd3d3d98a81020438ca805acded39dbab.tar.bz2
ingen-2c03f2abd3d3d98a81020438ca805acded39dbab.zip
Remove redundant and unnecessary properties from saved graphs and protocol.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5321 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events')
-rw-r--r--src/server/events/Delta.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index 072d0ba3..0c134ede 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -148,9 +148,10 @@ Delta::pre_process()
NodeImpl* obj = dynamic_cast<NodeImpl*>(_object);
+ // Remove any properties removed in delta
for (const auto& r : _remove) {
- const Raul::URI& key = r.first;
- const Atom& value = r.second;
+ const Raul::URI& key = r.first;
+ const Atom& value = r.second;
if (key == uris.midi_binding && value == uris.patch_wildcard) {
PortImpl* port = dynamic_cast<PortImpl*>(_object);
if (port)
@@ -161,6 +162,13 @@ Delta::pre_process()
}
}
+ // Remove all added properties if this is a put
+ if (_create && _object) {
+ for (const auto& p : _properties) {
+ _object->remove_property(p.first, p.second);
+ }
+ }
+
for (const auto& p : _properties) {
const Raul::URI& key = p.first;
const Resource::Property& value = p.second;