diff options
Diffstat (limited to 'src/libs/serialisation')
-rw-r--r-- | src/libs/serialisation/Loader.cpp | 13 | ||||
-rw-r--r-- | src/libs/serialisation/Serialiser.cpp | 6 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/libs/serialisation/Loader.cpp b/src/libs/serialisation/Loader.cpp index fb6f1e7c..e1eb3aa6 100644 --- a/src/libs/serialisation/Loader.cpp +++ b/src/libs/serialisation/Loader.cpp @@ -47,7 +47,7 @@ Loader::load(SharedPtr<EngineInterface> engine, boost::optional<Path> parent, string patch_name, Glib::ustring patch_uri, - GraphObject::Variables data) + GraphObject::Variables data) { setlocale(LC_NUMERIC, "C"); @@ -62,8 +62,7 @@ Loader::load(SharedPtr<EngineInterface> engine, else patch_uri = string("<") + patch_uri + ">"; - cerr << "[Loader] Loading " << patch_uri << " from " << document_uri - << " under " << (string)(parent ? (string)parent.get() : "no parent") << endl; + cout << "[Loader] Loading " << patch_uri; size_t patch_poly = 1; @@ -108,12 +107,12 @@ Loader::load(SharedPtr<EngineInterface> engine, patch_name = (*results.begin())["name"].to_string(); } - Path patch_path = ( parent ? (parent.get().base() + patch_name) : Path("/") ); - //cerr << "************ PATCH: name=" << patch_name << ", path=" << patch_path - // << ", poly = " << patch_poly << endl; + const Path patch_path = ( parent ? (parent.get().base() + patch_name) : Path("/") ); + + cout << " as " << patch_path << endl; + engine->create_patch(patch_path, patch_poly); - /* Load (plugin) nodes */ RDF::Query query(*rdf_world, Glib::ustring( diff --git a/src/libs/serialisation/Serialiser.cpp b/src/libs/serialisation/Serialiser.cpp index 83920d28..e3d33094 100644 --- a/src/libs/serialisation/Serialiser.cpp +++ b/src/libs/serialisation/Serialiser.cpp @@ -154,7 +154,7 @@ Serialiser::path_to_node_id(const Path& path) assert(i->second.get_node()); return i->second; } else { - RDF::Node id = _world.blank_id(); + RDF::Node id = _world.blank_id(path.name()); assert(id); _node_map[path] = id; return id; @@ -286,6 +286,10 @@ Serialiser::serialise_patch(SharedPtr<Shared::Patch> patch) serialise_variables(patch_id, patch->variables()); for (GraphObject::const_iterator n = patch->children_begin(); n != patch->children_end(); ++n) { + + if (n->second->graph_parent() != patch.get()) + continue; + SharedPtr<Shared::Patch> patch = PtrCast<Shared::Patch>(n->second); SharedPtr<Shared::Node> node = PtrCast<Shared::Node>(n->second); if (patch) { |