summaryrefslogtreecommitdiffstats
path: root/src/gui/PatchWindow.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-28 01:38:34 +0000
committerDavid Robillard <d@drobilla.net>2009-05-28 01:38:34 +0000
commitc9a25fcc6150290790457f837355735b513b7239 (patch)
tree0b234edf54525fe2e7883ffe6c10b5e15788065c /src/gui/PatchWindow.cpp
parent2f595631859574bfa7779ebb42f42b8590f5424c (diff)
downloadingen-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/PatchWindow.cpp')
-rw-r--r--src/gui/PatchWindow.cpp17
1 files changed, 8 insertions, 9 deletions
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);