From 2be10b0b6f2c0f01870208e9d18e5db87e5dfb88 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 24 Sep 2011 02:27:45 +0000 Subject: Only store patch canvas coordinates in containing patch. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3483 a436a847-0d15-0410-975c-d299462d15a1 --- src/shared/ResourceImpl.cpp | 12 +++++++----- src/shared/ResourceImpl.hpp | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/shared') diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp index 729a8152..e6f4ba70 100644 --- a/src/shared/ResourceImpl.cpp +++ b/src/shared/ResourceImpl.cpp @@ -27,16 +27,18 @@ namespace Ingen { namespace Shared { void -ResourceImpl::add_property(const Raul::URI& uri, const Raul::Atom& value) +ResourceImpl::add_property(const Raul::URI& uri, + const Raul::Atom& value, + Graph ctx) { // Ignore duplicate statements typedef Resource::Properties::const_iterator iterator; const std::pair range = _properties.equal_range(uri); for (iterator i = range.first; i != range.second && i != _properties.end(); ++i) - if (i->second == value) + if (i->second == value && i->second.context() == ctx) return; - _properties.insert(make_pair(uri, value)); + _properties.insert(make_pair(uri, Property(value, ctx))); } const Raul::Atom& @@ -165,7 +167,7 @@ void ResourceImpl::set_properties(const Properties& p) { for (Resource::Properties::const_iterator i = p.begin(); i != p.end(); ++i) { - set_property(i->first, i->second); + set_property(i->first, i->second, i->second.context()); } } @@ -174,7 +176,7 @@ ResourceImpl::add_properties(const Properties& p) { typedef Resource::Properties::const_iterator iterator; for (iterator i = p.begin(); i != p.end(); ++i) - add_property(i->first, i->second); + add_property(i->first, i->second, i->second.context()); } void diff --git a/src/shared/ResourceImpl.hpp b/src/shared/ResourceImpl.hpp index 0d96d840..6f5a2ed2 100644 --- a/src/shared/ResourceImpl.hpp +++ b/src/shared/ResourceImpl.hpp @@ -50,7 +50,8 @@ public: Resource::Graph ctx=Resource::DEFAULT); void remove_property(const Raul::URI& uri, const Raul::Atom& value); bool has_property(const Raul::URI& uri, const Raul::Atom& value) const; - void add_property(const Raul::URI& uri, const Raul::Atom& value); + void add_property(const Raul::URI& uri, const Raul::Atom& value, + Graph ctx=DEFAULT); void set_properties(const Properties& p); void add_properties(const Properties& p); void remove_properties(const Properties& p); -- cgit v1.2.1