summaryrefslogtreecommitdiffstats
path: root/src/Parser.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-10-25 17:47:28 +0000
committerDavid Robillard <d@drobilla.net>2015-10-25 17:47:28 +0000
commit1a33b800ac6245f59c99d76438feee8a21f04043 (patch)
treeaf66083a1af29ee514612c6e64e55fedf3762a05 /src/Parser.cpp
parentffae1d83620f0f57977c95e5e04f456bf0324b8c (diff)
downloadingen-1a33b800ac6245f59c99d76438feee8a21f04043.tar.gz
ingen-1a33b800ac6245f59c99d76438feee8a21f04043.tar.bz2
ingen-1a33b800ac6245f59c99d76438feee8a21f04043.zip
Fix saving and loading of copy-pasted blocks
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5785 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/Parser.cpp')
-rw-r--r--src/Parser.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Parser.cpp b/src/Parser.cpp
index 42dc1bac..376bb97d 100644
--- a/src/Parser.cpp
+++ b/src/Parser.cpp
@@ -289,12 +289,16 @@ parse_block(Ingen::World* world,
std::string type_uri;
for (const Sord::URI& prototype : prototype_predicates) {
- Sord::Iter i = model.find(subject, prototype, Sord::Node());
- if (!i.end() && i.get_object().type() == Sord::Node::URI) {
- type_uri = relative_uri(base_uri,
- i.get_object().to_string(),
- false);
- break;
+ for (Sord::Iter p = model.find(subject, prototype, Sord::Node()); !p.end(); ++p) {
+ const std::string prot_uri = relative_uri(
+ base_uri, p.get_object().to_string(), false);
+ if (serd_uri_string_has_scheme((const uint8_t*)prot_uri.c_str())) {
+ /* Ignore prototypes that are relative to this bundle, they are
+ blocks (probably from copy and paste), but we want files or
+ LV2 plugins here. */
+ type_uri = prot_uri;
+ break;
+ }
}
}