summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-08-29 01:04:18 +0000
committerDavid Robillard <d@drobilla.net>2015-08-29 01:04:18 +0000
commitd3768319106a5cf7824579ec3bf9ff1776c09383 (patch)
tree75ff9aee374306a7f7ecdc8e5cfc807dcbdc1a22
parent3b22d3c8c57867cad7304dac1e9be5ee36ae9715 (diff)
downloadingen-d3768319106a5cf7824579ec3bf9ff1776c09383.tar.gz
ingen-d3768319106a5cf7824579ec3bf9ff1776c09383.tar.bz2
ingen-d3768319106a5cf7824579ec3bf9ff1776c09383.zip
Fix invalid conversion of URIDs to strings.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5709 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/client/BlockModel.cpp2
-rw-r--r--src/client/ClientStore.cpp15
-rw-r--r--src/gui/RDFS.cpp15
3 files changed, 20 insertions, 12 deletions
diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp
index 67261dba..e3f7d22f 100644
--- a/src/client/BlockModel.cpp
+++ b/src/client/BlockModel.cpp
@@ -239,7 +239,7 @@ std::string
BlockModel::port_label(SPtr<const PortModel> port) const
{
const Atom& name = port->get_property(Raul::URI(LV2_CORE__name));
- if (name.is_valid()) {
+ if (name.is_valid() && name.type() == _uris.forge.String) {
return name.ptr<char>();
}
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index 5adf7f52..b055a88c 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -307,14 +307,15 @@ ClientStore::put(const Raul::URI& uri,
}
SPtr<PluginModel> plug;
- if (p->second.is_valid() && p->second.type() == _uris.forge.URI) {
- if (!(plug = _plugin(Raul::URI(p->second.ptr<char>())))) {
+ if (p->second.is_valid() && (p->second.type() == _uris.forge.URI ||
+ p->second.type() == _uris.forge.URID)) {
+ const Raul::URI uri(_uris.forge.str(p->second, false));
+ if (!(plug = _plugin(uri))) {
plug = SPtr<PluginModel>(
- new PluginModel(
- uris(),
- Raul::URI(p->second.ptr<char>()),
- Atom(),
- Resource::Properties()));
+ new PluginModel(uris(),
+ uri,
+ Atom(),
+ Resource::Properties()));
add_plugin(plug);
}
diff --git a/src/gui/RDFS.cpp b/src/gui/RDFS.cpp
index 78893112..baa51943 100644
--- a/src/gui/RDFS.cpp
+++ b/src/gui/RDFS.cpp
@@ -14,6 +14,7 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ingen/Log.hpp"
#include "ingen/Resource.hpp"
#include "ingen/World.hpp"
#include "ingen/client/ObjectModel.hpp"
@@ -121,10 +122,16 @@ types(World* world, SPtr<const Client::ObjectModel> model)
types.insert(Raul::URI(LILV_NS_RDFS "Resource"));
PropRange range = model->properties().equal_range(world->uris().rdf_type);
for (PropIter t = range.first; t != range.second; ++t) {
- types.insert(Raul::URI(t->second.ptr<char>()));
- if (world->uris().ingen_Graph == t->second.ptr<char>()) {
- // Add lv2:Plugin as a type for graphs so plugin properties show up
- types.insert(world->uris().lv2_Plugin);
+ if (t->second.type() == world->forge().URI ||
+ t->second.type() == world->forge().URID) {
+ const Raul::URI type(world->forge().str(t->second, false));
+ types.insert(type);
+ if (world->uris().ingen_Graph == type) {
+ // Add lv2:Plugin as a type for graphs so plugin properties show up
+ types.insert(world->uris().lv2_Plugin);
+ }
+ } else {
+ world->log().error(fmt("<%1%> has non-URI type\n") % model->uri());
}
}