diff options
author | David Robillard <d@drobilla.net> | 2015-10-26 16:29:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-10-26 16:29:11 +0000 |
commit | 965a74ae42dae3ff42f1dcc7c53dddb2b5a31b09 (patch) | |
tree | 10fddc515234d9a1fc5724d134b88eb8c124904f /src/gui | |
parent | 06eb959bf1c249dd66a5a56b78df0ad0de7df29c (diff) | |
download | ingen-965a74ae42dae3ff42f1dcc7c53dddb2b5a31b09.tar.gz ingen-965a74ae42dae3ff42f1dcc7c53dddb2b5a31b09.tar.bz2 ingen-965a74ae42dae3ff42f1dcc7c53dddb2b5a31b09.zip |
Use URIDs almost everywhere
This fixes some issues where types are lost after saving and
re-loading many times.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5788 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/GraphCanvas.cpp | 5 | ||||
-rw-r--r-- | src/gui/LoadPluginWindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/NodeMenu.cpp | 2 | ||||
-rw-r--r-- | src/gui/PropertiesWindow.cpp | 21 |
4 files changed, 12 insertions, 18 deletions
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp index be1b9de8..16739a55 100644 --- a/src/gui/GraphCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -756,8 +756,7 @@ GraphCanvas::menu_add_port(const string& sym_base, const string& name_base, const URIs& uris = _app.uris(); Resource::Properties props = get_initial_data(); - props.insert(make_pair(uris.rdf_type, - _app.forge().alloc_uri(type))); + props.insert(make_pair(uris.rdf_type, _app.forge().make_urid(type))); if (type == uris.atom_AtomPort) { props.insert(make_pair(uris.atom_bufferType, Resource::Property(uris.atom_Sequence))); @@ -796,7 +795,7 @@ GraphCanvas::load_plugin(WPtr<PluginModel> weak_plugin) props.insert(make_pair(uris.rdf_type, Resource::Property(uris.ingen_Block))); props.insert(make_pair(uris.lv2_prototype, - uris.forge.alloc_uri(plugin->uri()))); + uris.forge.make_urid(plugin->uri()))); _app.interface()->put(Node::path_to_uri(path), props); } diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index 073936a8..5d66e7d6 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -396,7 +396,7 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter) props.insert(make_pair(uris.rdf_type, Resource::Property(uris.ingen_Block))); props.insert(make_pair(uris.lv2_prototype, - _app->forge().alloc_uri(plugin->uri()))); + _app->forge().make_urid(plugin->uri()))); props.insert(make_pair(uris.ingen_polyphonic, _app->forge().make(polyphonic))); _app->interface()->put(Node::path_to_uri(path), props); diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index 7d1d3274..9d827d59 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -234,7 +234,7 @@ NodeMenu::on_preset_activated(const std::string& uri) { _app->set_property(block()->uri(), _app->uris().pset_preset, - _app->forge().alloc_uri(uri)); + _app->forge().make_urid(Raul::URI(uri))); } bool diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp index 0ae2709d..09474027 100644 --- a/src/gui/PropertiesWindow.cpp +++ b/src/gui/PropertiesWindow.cpp @@ -449,16 +449,16 @@ PropertiesWindow::get_value(LV2_URID type, Gtk::Widget* value_widget) if (check) { return _app->forge().make(check->get_active()); } - } else if (type == forge.URI) { + } else if (type == forge.URI || type == forge.URID) { URIEntry* uri_entry = dynamic_cast<URIEntry*>(value_widget); if (uri_entry) { - return _app->forge().alloc_uri(uri_entry->get_text()); - } - } else if (type == forge.URID) { - URIEntry* uri_entry = dynamic_cast<URIEntry*>(value_widget); - if (uri_entry) { - return _app->forge().make_urid( - _app->world()->uri_map().map_uri(uri_entry->get_text())); + if (Raul::URI::is_valid(uri_entry->get_text())) { + return _app->forge().make_urid( + _app->world()->uri_map().map_uri(uri_entry->get_text())); + } else { + _app->log().error(fmt("Invalid URI <%1%>\n\n") + % uri_entry->get_text()); + } } } else if (type == forge.String) { Gtk::Entry* entry = dynamic_cast<Gtk::Entry*>(value_widget); @@ -467,11 +467,6 @@ PropertiesWindow::get_value(LV2_URID type, Gtk::Widget* value_widget) } } - URIEntry* uri_entry = dynamic_cast<URIEntry*>(value_widget); - if (uri_entry) { - return _app->forge().alloc_uri(uri_entry->get_text()); - } - return Atom(); } |