diff options
author | David Robillard <d@drobilla.net> | 2018-09-23 21:38:03 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-23 21:38:03 +0200 |
commit | 754c696dc2c755d3bcaca96246ab81381edc0ad1 (patch) | |
tree | 2cb7610fd0bfa5802ebfef51ba8f510f25130a0e /src | |
parent | 5d13ad11340a73214642245f4418aec9f197186d (diff) | |
download | ingen-754c696dc2c755d3bcaca96246ab81381edc0ad1.tar.gz ingen-754c696dc2c755d3bcaca96246ab81381edc0ad1.tar.bz2 ingen-754c696dc2c755d3bcaca96246ab81381edc0ad1.zip |
Parse overridden properties with a single PUT
Diffstat (limited to 'src')
-rw-r--r-- | src/Parser.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Parser.cpp b/src/Parser.cpp index c9736a71..0288497e 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -503,13 +503,19 @@ parse_properties(ingen::World* world, { Properties properties = get_properties(world, model, subject, ctx); - target->put(uri, properties, ctx); - - // Set passed properties last to override any loaded values + // Replace any properties given in `data` if (data) { - target->put(uri, data.get(), ctx); + for (const auto& prop : *data) { + properties.erase(prop.first); + } + + for (const auto& prop : *data) { + properties.emplace(prop); + } } + target->put(uri, properties, ctx); + return true; } |