summaryrefslogtreecommitdiffstats
path: root/src/serialisation
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-22 05:43:15 +0000
committerDavid Robillard <d@drobilla.net>2008-11-22 05:43:15 +0000
commit830a9b4ba0caa521289730eddd7bcb903b7662d3 (patch)
tree4b185b61322fb8b6de1358b8ed7ee263ebe5977a /src/serialisation
parent5e4a6540200af8a7c6b5fd1a0ae4ef8aef4fb8e8 (diff)
downloadingen-830a9b4ba0caa521289730eddd7bcb903b7662d3.tar.gz
ingen-830a9b4ba0caa521289730eddd7bcb903b7662d3.tar.bz2
ingen-830a9b4ba0caa521289730eddd7bcb903b7662d3.zip
Fix subpatch loading (fix ticket #271).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1760 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation')
-rw-r--r--src/serialisation/Parser.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp
index 0bd8b476..c722b21e 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/serialisation/Parser.cpp
@@ -70,10 +70,13 @@ Parser::parse_document(
{
Redland::Model model(*world->rdf_world, document_uri, document_uri);
- if (object_uri == document_uri || object_uri == "")
- cout << "Parsing document " << object_uri << endl;
- else
+ if (object_uri == document_uri || object_uri == "") {
+ cout << "Parsing " << object_uri << " from " << document_uri << endl;
+ cout << "Base: " << engine_base;
+ cout << ", Symbol: " << ((bool)symbol ? symbol.get() : "_") << endl;
+ } else {
cout << "Parsing " << object_uri << " from " << document_uri << endl;
+ }
return parse(world, target, model, document_uri, engine_base, object_uri, symbol, data);;
}
@@ -324,13 +327,19 @@ Parser::parse_patch(
patch_poly = static_cast<uint32_t>(poly_node.to_int());
}
- string symbol = uri_relative_to_base(base_uri, object_uri);
- symbol = symbol.substr(0, symbol.find("."));
+ string symbol;
+ if (object_uri != "") {
+ symbol = uri_relative_to_base(base_uri, object_uri);
+ } else {
+ symbol = base_uri.substr(base_uri.find_last_of("/") + 1);
+ symbol = symbol.substr(0, symbol.find("."));
+ }
+
Path patch_path("/");
if (engine_base == "")
patch_path = "/";
else if (engine_base[engine_base.length()-1] == '/')
- patch_path = Path(engine_base + symbol);
+ patch_path = Path(engine_base + Path::nameify(symbol));
else if (Path::is_valid(engine_base))
patch_path = (Path)engine_base;
else if (Path::is_valid(string("/").append(engine_base)))
@@ -605,9 +614,6 @@ Parser::parse_connections(
continue;
}
- src_path = src_path.substr(parent.base().length()-1);
- dst_path = dst_path.substr(parent.base().length()-1);
-
target->connect(src_path, dst_path);
}