diff options
author | David Robillard <d@drobilla.net> | 2007-10-21 19:02:02 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-21 19:02:02 +0000 |
commit | 608aeac60ef43243b85c0dcc5894ccc79f35fba5 (patch) | |
tree | b9cbd2f0594602a8d927fa486e7682daf0b92fc3 /src/libs/gui/PatchWindow.cpp | |
parent | 89a9cdf0ab581a4cff5cf8fd859d714a90bb8998 (diff) | |
download | ingen-608aeac60ef43243b85c0dcc5894ccc79f35fba5.tar.gz ingen-608aeac60ef43243b85c0dcc5894ccc79f35fba5.tar.bz2 ingen-608aeac60ef43243b85c0dcc5894ccc79f35fba5.zip |
Fix crash on OSC connection.
Fix patch filename persistance.
git-svn-id: http://svn.drobilla.net/lad/ingen@894 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/PatchWindow.cpp')
-rw-r--r-- | src/libs/gui/PatchWindow.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp index 716d4356..5569c037 100644 --- a/src/libs/gui/PatchWindow.cpp +++ b/src/libs/gui/PatchWindow.cpp @@ -304,10 +304,11 @@ PatchWindow::event_import_location() void PatchWindow::event_save() { - if (_patch->filename() == "") + GraphObject::Variables::const_iterator doc = _patch->variables().find("ingen:document"); + if (doc == _patch->variables().end()) event_save_as(); else - App::instance().loader()->save_patch(_patch, _patch->filename()); + App::instance().loader()->save_patch(_patch, doc->second.get_string()); } @@ -330,9 +331,9 @@ PatchWindow::event_save_as() save_button->property_has_default() = true; // Set current folder to most sensible default - const string& current_filename = _patch->filename(); - if (current_filename.length() > 0) - dialog.set_filename(current_filename); + GraphObject::Variables::const_iterator doc = _patch->variables().find("ingen:document"); + if (doc != _patch->variables().end()) + dialog.set_uri(doc->second.get_string()); else if (App::instance().configuration()->patch_folder().length() > 0) dialog.set_current_folder(App::instance().configuration()->patch_folder()); @@ -365,8 +366,8 @@ PatchWindow::event_save_as() if (confirm) { App::instance().loader()->save_patch(_patch, filename); - _patch->set_filename(filename); - //_patch->set_variable("filename", Atom(filename.c_str())); + App::instance().engine()->set_variable(_patch->path(), "ingen:document", + Atom(Glib::filename_to_uri(filename).c_str())); } } App::instance().configuration()->set_patch_folder(dialog.get_current_folder()); |