summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-09-24 02:27:45 +0000
committerDavid Robillard <d@drobilla.net>2011-09-24 02:27:45 +0000
commit2be10b0b6f2c0f01870208e9d18e5db87e5dfb88 (patch)
treee5bf3a28b59978c6464bb07eac160a458b01cd0d /src/shared
parent4cc5c82a87cf2316f425a9ea1de0fb29d0c24c8e (diff)
downloadingen-2be10b0b6f2c0f01870208e9d18e5db87e5dfb88.tar.gz
ingen-2be10b0b6f2c0f01870208e9d18e5db87e5dfb88.tar.bz2
ingen-2be10b0b6f2c0f01870208e9d18e5db87e5dfb88.zip
Only store patch canvas coordinates in containing patch.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3483 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/ResourceImpl.cpp12
-rw-r--r--src/shared/ResourceImpl.hpp3
2 files changed, 9 insertions, 6 deletions
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<iterator,iterator> 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);