summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-07-05 00:09:34 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-07-05 00:09:34 +0000
commitdfb5fef0a7dbdffe08bea23b48f4f182308e9b7c (patch)
treee66cd6ba525c4f31ee27213ad4f22116f9bbbf46 /gtk2_ardour
parent6e72885a5422b2d5aa9fdceec5652e5a0d7be116 (diff)
handle session names provided by user that contain '/' (mantis #1193)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5326 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 726873dffc..f99f548398 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -2209,8 +2209,9 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
Glib::ustring session_name;
Glib::ustring session_path;
Glib::ustring template_name;
+ Glib::ustring legal_session_folder_name;
int response;
-
+
begin:
response = Gtk::RESPONSE_NONE;
@@ -2307,7 +2308,7 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
if (response == Gtk::RESPONSE_OK) {
session_name = new_session_dialog->session_name();
-
+
if (session_name.empty()) {
response = Gtk::RESPONSE_NONE;
goto try_again;
@@ -2325,7 +2326,7 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
session_name = Glib::path_get_basename (session_name);
} else {
-
+
session_path = new_session_dialog->session_folder();
}
@@ -2340,11 +2341,13 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
case NewSessionDialog::NewPage: /* nominally the "new" session creator, but could be in use for an old session */
should_be_new = true;
-
+
+ legal_session_folder_name = legalize_for_path (session_name);
+
//XXX This is needed because session constructor wants a
//non-existant path. hopefully this will be fixed at some point.
-
- session_path = Glib::build_filename (session_path, session_name);
+
+ session_path = Glib::build_filename (session_path, legal_session_folder_name);
if (Glib::file_test (session_path, Glib::FileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {