summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-04-05 22:29:15 +0000
committerDavid Robillard <d@drobilla.net>2015-04-05 22:29:15 +0000
commita219a9c8e08bbd571661b676bd57f4e7bf08e421 (patch)
tree561fc7fea865aabe66249eb9b2e752d3c46199f2 /src
parent70c4e18c7dcec1bcedba78594d9005f2034c63dc (diff)
downloadingen-a219a9c8e08bbd571661b676bd57f4e7bf08e421.tar.gz
ingen-a219a9c8e08bbd571661b676bd57f4e7bf08e421.tar.bz2
ingen-a219a9c8e08bbd571661b676bd57f4e7bf08e421.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/Serialiser.cpp23
1 files changed, 4 insertions, 19 deletions
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<const Node> 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<char>())) {
- 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<char>());
- }
-
// 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);