diff options
author | David Robillard <d@drobilla.net> | 2011-09-23 19:44:47 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-09-23 19:44:47 +0000 |
commit | 53f83f508516d2dddf027782dce6dd045bcf1943 (patch) | |
tree | ecb1d924ebc0104205755484355e7d8dad25f8b5 /src/shared/ResourceImpl.cpp | |
parent | 9a99f038176a7fadc59bbeaa3d3d57f16e4abb74 (diff) | |
download | ingen-53f83f508516d2dddf027782dce6dd045bcf1943.tar.gz ingen-53f83f508516d2dddf027782dce6dd045bcf1943.tar.bz2 ingen-53f83f508516d2dddf027782dce6dd045bcf1943.zip |
Don't prompt for save location when path is already known from previous save or load.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3476 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared/ResourceImpl.cpp')
-rw-r--r-- | src/shared/ResourceImpl.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp index d315b8f0..14227ccf 100644 --- a/src/shared/ResourceImpl.cpp +++ b/src/shared/ResourceImpl.cpp @@ -40,10 +40,20 @@ ResourceImpl::add_property(const Raul::URI& uri, const Raul::Atom& value) } Raul::Atom& -ResourceImpl::set_property(const Raul::URI& uri, const Raul::Atom& value) +ResourceImpl::set_property(const Raul::URI& uri, const Raul::Atom& value, + Resource::Graph ctx) { - _properties.erase(uri); - return _properties.insert(make_pair(uri, value))->second; + // Erase existing property in this context + for (Properties::iterator i = _properties.find(uri); + (i != _properties.end()) && (i->first == uri); + ++i) { + if (i->second.context() == ctx && i->second == value) { + _properties.erase(i); + } + } + + // Insert new property + return _properties.insert(make_pair(uri, Property(value, ctx)))->second; } void |