summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-10-08 14:17:57 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-10-08 14:17:57 +0000
commitaee0eabca4fbf8dbf8f2ed45cc9697a5704bb6fc (patch)
treeaa616b608aa52ea2ab1753c2af33687691144668
parent3177c9b0b42b9542d12d8ade18906faec6f68735 (diff)
if user asks for session templates, make sure user template dir exists, and switch file browser default to that dir
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5755 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/new_session_dialog.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk2_ardour/new_session_dialog.cc b/gtk2_ardour/new_session_dialog.cc
index 7ee04b5b31..0fecaf3cf0 100644
--- a/gtk2_ardour/new_session_dialog.cc
+++ b/gtk2_ardour/new_session_dialog.cc
@@ -411,8 +411,15 @@ printf("system template path = %s\n", sys_templates_path.c_str());
//if USER template folder exists, add it to the file chooser
const std::string user_template_path = ARDOUR::get_user_ardour_path() + template_dir_name;
- if (Glib::file_test(user_template_path, Glib::FILE_TEST_IS_DIR))
- {
+ bool utp_exists = true;
+
+ if (!Glib::file_test(user_template_path, Glib::FILE_TEST_IS_DIR)) {
+ if (g_mkdir_with_parents (user_template_path.c_str(), 0755)) {
+ utp_exists = false;
+ }
+ }
+
+ if (utp_exists) {
m_template->add_shortcut_folder(user_template_path);
m_template->set_current_folder (user_template_path);
}