From a219a9c8e08bbd571661b676bd57f4e7bf08e421 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 5 Apr 2015 22:29:15 +0000 Subject: Don't save symbol (problematic on save as). This is less than ideal, since it would be nice to be able to set a symbol for a graph (being a good idea for plugins in general), but this sorts out an issue for now. The symbol of a graph is currently always the name of its bundle. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5667 a436a847-0d15-0410-975c-d299462d15a1 --- src/Serialiser.cpp | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/Serialiser.cpp b/src/Serialiser.cpp index 4fff59b9..d5e54f3d 100644 --- a/src/Serialiser.cpp +++ b/src/Serialiser.cpp @@ -302,28 +302,13 @@ Serialiser::Impl::serialise_graph(SPtr graph, Sord::URI(world, LV2_UI__ui), Sord::URI(world, "http://drobilla.net/ns/ingen#GraphUIGtk2")); - // Always write a symbol (required by Ingen) - Raul::Symbol symbol("_"); - Node::Properties::const_iterator s = graph->properties().find(uris.lv2_symbol); - if (s == graph->properties().end() - || s->second.type() != _world.forge().String - || !Raul::Symbol::is_valid(s->second.ptr())) { - const std::string base = Glib::path_get_basename( - _model->base_uri().to_c_string()); - symbol = Raul::Symbol::symbolify(base.substr(0, base.find('.'))); - _model->add_statement( - graph_id, - Sord::URI(world, uris.lv2_symbol), - Sord::Literal(world, symbol.c_str())); - } else { - symbol = Raul::Symbol::symbolify(s->second.ptr()); - } - // If the graph has no doap:name (required by LV2), use the symbol - if (graph->properties().find(uris.doap_name) == graph->properties().end()) + if (graph->properties().find(uris.doap_name) == graph->properties().end()) { + const std::string sym = Glib::path_get_basename(graph_id.to_string()); _model->add_statement(graph_id, Sord::URI(world, uris.doap_name), - Sord::Literal(world, symbol.c_str())); + Sord::Literal(world, sym)); + } const Node::Properties props = graph->properties(Resource::Graph::INTERNAL); serialise_properties(graph_id, props); -- cgit v1.2.1