From c28fe36d38ce83e1c8421e2db75d9d41909a6acf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 27 Nov 2008 03:15:57 +0000 Subject: Remember document name (so File->Save doesn't prompt). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1786 a436a847-0d15-0410-975c-d299462d15a1 --- src/serialisation/Parser.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/serialisation') diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index f4e1f40c..408a3c7d 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -88,7 +88,17 @@ Parser::parse_document( if (symbol) cout << "[Parser] Symbol: " << symbol.get() << endl; - return parse(world, target, model, document_uri, engine_base, object_uri, symbol, data);; + bool ret = parse(world, target, model, document_uri, engine_base, object_uri, symbol, data); + + const string object_path = (document_uri == object_uri) ? "/" + : uri_relative_to_base(document_uri, object_uri); + + if (Path::is_valid(object_path)) + target->set_variable(object_path, "ingen:document", Atom(document_uri.c_str())); + else + cerr << "WARNING: " << object_path << " is not a valid path, document URI lost" << endl; + + return ret; } @@ -269,8 +279,6 @@ Parser::parse( if (rdf_class == patch_class) { ret = parse_patch(world, target, model, base_uri, engine_base, path_str, data); - //if (ret) - // target->set_variable(path, "ingen:document", Atom(base_uri.c_str())); } else if (rdf_class == node_class) { ret = parse_node(world, target, model, base_uri, Glib::ustring("<") + subject.to_c_string() + ">", path, data); -- cgit v1.2.1