Use sys::path and SessionDirectory in Session::create_session_file_from_template...
authorTim Mayberry <mojofunk@gmail.com>
Tue, 4 Sep 2007 04:47:51 +0000 (04:47 +0000)
committerTim Mayberry <mojofunk@gmail.com>
Tue, 4 Sep 2007 04:47:51 +0000 (04:47 +0000)
git-svn-id: svn://localhost/ardour2/trunk@2370 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/session_state.cc

index ed1ae82f319b4871714d7a044f98edf67e2a1605..9074a0778cc42d897a2cda524a12bfd4387a1b2b 100644 (file)
@@ -439,9 +439,11 @@ Session::create_session_file ()
 bool
 Session::create_session_file_from_template (const string& template_path)
 {
-       string out_path = _path + _name + statefile_suffix;
+       sys::path session_file_path(_session_dir->root_path());
 
-       if(!copy_file (template_path, out_path)) {
+       session_file_path /= _name + statefile_suffix;
+
+       if(!copy_file (template_path, session_file_path.to_string())) {
                error << string_compose (_("Could not use session template %1 to create new session."), template_path) 
                        << endmsg;
                return false;