diff options
author | David Robillard <d@drobilla.net> | 2015-03-28 01:35:27 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-03-28 01:35:27 +0000 |
commit | f4d8b438532b3c090094b4060d6e0a2b2fba9d4d (patch) | |
tree | 40339fff10921ad264fff3ace8a04c4b52d7c505 /src/gui/RDFS.cpp | |
parent | ac60550c32598ad91f941722913f1629d5c9a35f (diff) | |
download | ingen-f4d8b438532b3c090094b4060d6e0a2b2fba9d4d.tar.gz ingen-f4d8b438532b3c090094b4060d6e0a2b2fba9d4d.tar.bz2 ingen-f4d8b438532b3c090094b4060d6e0a2b2fba9d4d.zip |
Improve properties window.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5646 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/RDFS.cpp')
-rw-r--r-- | src/gui/RDFS.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/gui/RDFS.cpp b/src/gui/RDFS.cpp index 671ef69e..a24ae002 100644 --- a/src/gui/RDFS.cpp +++ b/src/gui/RDFS.cpp @@ -41,6 +41,22 @@ label(World* world, const LilvNode* node) return label; } +Glib::ustring +comment(World* world, const LilvNode* node) +{ + LilvNode* rdfs_comment = lilv_new_uri( + world->lilv_world(), LILV_NS_RDFS "comment"); + LilvNodes* comments = lilv_world_find_nodes( + world->lilv_world(), node, rdfs_comment, NULL); + + const LilvNode* first = lilv_nodes_get_first(comments); + Glib::ustring comment = first ? lilv_node_as_string(first) : ""; + + lilv_nodes_free(comments); + lilv_node_free(rdfs_comment); + return comment; +} + void classes(World* world, URISet& types, bool super) { @@ -158,8 +174,11 @@ instances(World* world, const URISet& types) LilvNodes* objects = lilv_world_find_nodes( world->lilv_world(), NULL, rdf_type, type); LILV_FOREACH(nodes, o, objects) { - const LilvNode* object = lilv_nodes_get(objects, o); - const Glib::ustring label = RDFS::label(world, object); + const LilvNode* object = lilv_nodes_get(objects, o); + if (!lilv_node_is_uri(object)) { + continue; + } + const Glib::ustring label = RDFS::label(world, object); result.insert( std::make_pair( Raul::URI(lilv_node_as_string(object)), |