diff options
author | David Robillard <d@drobilla.net> | 2009-05-28 01:38:34 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-28 01:38:34 +0000 |
commit | c9a25fcc6150290790457f837355735b513b7239 (patch) | |
tree | 0b234edf54525fe2e7883ffe6c10b5e15788065c /src/gui | |
parent | 2f595631859574bfa7779ebb42f42b8590f5424c (diff) | |
download | ingen-c9a25fcc6150290790457f837355735b513b7239.tar.gz ingen-c9a25fcc6150290790457f837355735b513b7239.tar.bz2 ingen-c9a25fcc6150290790457f837355735b513b7239.zip |
Fix QNAMEs being serialised as URIs.
Remove vestigial variable stuff.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2017 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/NewSubpatchWindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/NodeModule.cpp | 2 | ||||
-rw-r--r-- | src/gui/PatchPortModule.cpp | 8 | ||||
-rw-r--r-- | src/gui/PatchView.cpp | 8 | ||||
-rw-r--r-- | src/gui/PatchWindow.cpp | 17 | ||||
-rw-r--r-- | src/gui/UploadPatchWindow.cpp | 2 |
6 files changed, 19 insertions, 20 deletions
diff --git a/src/gui/NewSubpatchWindow.cpp b/src/gui/NewSubpatchWindow.cpp index 0a0f11f5..3c697d81 100644 --- a/src/gui/NewSubpatchWindow.cpp +++ b/src/gui/NewSubpatchWindow.cpp @@ -97,7 +97,7 @@ NewSubpatchWindow::ok_clicked() Resource::Properties props; props.insert(make_pair("rdf:type", Atom(Atom::URI, "ingen:Patch"))); props.insert(make_pair("ingen:polyphony", Atom(int32_t(poly)))); - App::instance().engine()->put(path, props); + App::instance().engine()->put(ResourceImpl::meta_uri(Path::root_uri, path), props); for (GraphObject::Properties::const_iterator i = _initial_data.begin(); i != _initial_data.end(); ++i) App::instance().engine()->set_property(path, i->first, i->second); diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index b507bba7..b330ab8d 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -92,7 +92,7 @@ NodeModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> n else ret = boost::shared_ptr<NodeModule>(new NodeModule(canvas, node)); - for (GraphObject::Properties::const_iterator m = node->variables().begin(); m != node->variables().end(); ++m) + for (GraphObject::Properties::const_iterator m = node->meta().properties().begin(); m != node->meta().properties().end(); ++m) ret->set_property(m->first, m->second); for (GraphObject::Properties::const_iterator m = node->properties().begin(); m != node->properties().end(); ++m) diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index bdd93f63..6ceea483 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -62,8 +62,8 @@ PatchPortModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortMod ret->set_port(port); ret->set_menu(port->menu()); - for (GraphObject::Properties::const_iterator m = model->variables().begin(); - m != model->variables().end(); ++m) + for (GraphObject::Properties::const_iterator m = model->meta().properties().begin(); + m != model->meta().properties().end(); ++m) ret->set_property(m->first, m->second); for (GraphObject::Properties::const_iterator m = model->properties().begin(); @@ -101,8 +101,8 @@ PatchPortModule::store_location() if (existing_x.type() != Atom::FLOAT || existing_y.type() != Atom::FLOAT || existing_x.get_float() != x || existing_y.get_float() != y) { - App::instance().engine()->set_property(_model->path(), "ingenuity:canvas-x", Atom(x)); - App::instance().engine()->set_property(_model->path(), "ingenuity:canvas-y", Atom(y)); + App::instance().engine()->set_property(_model->meta_uri(), "ingenuity:canvas-x", Atom(x)); + App::instance().engine()->set_property(_model->meta_uri(), "ingenuity:canvas-y", Atom(y)); } } diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index 812c3115..ad62d43e 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -81,12 +81,12 @@ PatchView::set_patch(SharedPtr<PatchModel> patch) _poly_spin->set_value(patch->poly()); - for (GraphObject::Properties::const_iterator i = patch->properties().begin(); - i != patch->properties().end(); ++i) + for (GraphObject::Properties::const_iterator i = patch->meta().properties().begin(); + i != patch->meta().properties().end(); ++i) property_changed(i->first, i->second); - for (GraphObject::Properties::const_iterator i = patch->variables().begin(); - i != patch->variables().end(); ++i) + for (GraphObject::Properties::const_iterator i = patch->properties().begin(); + i != patch->properties().end(); ++i) property_changed(i->first, i->second); // Connect model signals to track state diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index 3984c9be..3b5c3f9b 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -396,14 +396,13 @@ PatchWindow::event_import_location() void PatchWindow::event_save() { - GraphObject::Properties::const_iterator doc = _patch->variables().find("ingen:document"); - if (doc == _patch->variables().end()) { + const Raul::Atom& document = _patch->get_property("ingen:document"); + if (!document.is_valid() || document.type() != Raul::Atom::URI) { event_save_as(); } else { - const Glib::ustring& document_uri = doc->second.get_string(); - App::instance().loader()->save_patch(_patch, document_uri); + App::instance().loader()->save_patch(_patch, document.get_uri()); _status_bar->push( - (boost::format("Wrote %1% to %2%") % _patch->path() % document_uri).str(), + (boost::format("Wrote %1% to %2%") % _patch->path() % document.get_uri()).str(), STATUS_CONTEXT_PATCH); } } @@ -427,9 +426,9 @@ PatchWindow::event_save_as() dialog.set_filter(filt); // Set current folder to most sensible default - GraphObject::Properties::const_iterator doc = _patch->variables().find("ingen:document"); - if (doc != _patch->variables().end()) - dialog.set_uri(doc->second.get_string()); + const Raul::Atom& document = _patch->get_property("ingen:document"); + if (document.type() == Raul::Atom::URI) + dialog.set_uri(document.get_uri()); else if (App::instance().configuration()->patch_folder().length() > 0) dialog.set_current_folder(App::instance().configuration()->patch_folder()); @@ -477,7 +476,7 @@ PatchWindow::event_save_as() if (confirm) { const Glib::ustring uri = Glib::filename_to_uri(filename); App::instance().loader()->save_patch(_patch, uri); - _patch->set_property("ingen:document", Atom(uri.c_str())); + _patch->set_property("ingen:document", Atom(Atom::URI, uri.c_str())); _status_bar->push( (boost::format("Wrote %1% to %2%") % _patch->path() % uri).str(), STATUS_CONTEXT_PATCH); diff --git a/src/gui/UploadPatchWindow.cpp b/src/gui/UploadPatchWindow.cpp index 0057ec18..1d930cb5 100644 --- a/src/gui/UploadPatchWindow.cpp +++ b/src/gui/UploadPatchWindow.cpp @@ -79,7 +79,7 @@ UploadPatchWindow::on_show() if (atom.is_valid()) _symbol_entry->set_text(atom.get_string()); - atom = _patch->get_variable("doap:name"); + atom = _patch->get_property("doap:name"); if (atom.is_valid()) _short_name_entry->set_text(atom.get_string()); } |