View Issue Details

IDProjectCategoryView StatusLast Update
0002265ardourbugspublic2011-08-16 11:16
Reportercolinf Assigned Topaul  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionSVN/2.0-ongoing 
Summary0002265: "Save Template..." missing '/' from path causes templates to be saved in the wrong place
Description"Save Template..." saves in the wrong place, due to a missing '/' from the path. E.g., saving a template 'xxx' should save to ~/.ardour2/templates/xxx.template, but it actaully goes to ~/.ardour2/templatesxxx.template.

Additional InformationAttached the (pretty trivial) patch, using Glib::build_filename() to construct the proper path to the template file.
TagsNo tags attached.

Activities

2008-05-22 11:01

 

template-path.patch (1,218 bytes)   
Index: libs/ardour/session_state.cc
===================================================================
--- libs/ardour/session_state.cc	(revision 3381)
+++ libs/ardour/session_state.cc	(working copy)
@@ -1672,9 +1672,7 @@
 
 	tree.set_root (&get_template());
 
-	xml_path = dir;
-	xml_path += template_name;
-	xml_path += _template_suffix;
+	xml_path = Glib::build_filename(dir, template_name + _template_suffix);
 
 	ifstream in(xml_path.c_str());
 	
@@ -1696,8 +1694,8 @@
 int
 Session::rename_template (string old_name, string new_name) 
 {
-	string old_path = template_dir() + old_name + _template_suffix;
-	string new_path = template_dir() + new_name + _template_suffix;
+	string old_path = Glib::build_filename(template_dir(), old_name + _template_suffix);
+	string new_path = Glib::build_filename(template_dir(), new_name + _template_suffix);
 
 	return rename (old_path.c_str(), new_path.c_str());
 }
@@ -1705,9 +1703,7 @@
 int
 Session::delete_template (string name) 
 {
-	string template_path = template_dir();
-	template_path += name;
-	template_path += _template_suffix;
+	string template_path = Glib::build_filename(template_dir(), name + _template_suffix);
 
 	return remove (template_path.c_str());
 }
template-path.patch (1,218 bytes)   

colinf

2008-05-22 13:21

updater   ~0004957

This seems to affect more than just templates: it's from svn 3347, "use Glib::build_filename() more widely", which changed Session::peak_dir (), Session::automation_dir (), Session::analysis_dir (), Session::template_dir () and Session::export_dir () to use Glib::build_filename(), but also changed them to not return a '/' at the end of their respective paths.

So sessions are ending up with files like peaksAudio 1-1%L%A.peak in the session directory, rather than peaks/Audio 1-1%L%A.peak.

paul

2008-05-22 13:27

administrator   ~0004958

patch applied to svn, rev 3386. thanks!

Issue History

Date Modified Username Field Change
2008-05-22 11:01 colinf New Issue
2008-05-22 11:01 colinf File Added: template-path.patch
2008-05-22 13:21 colinf Note Added: 0004957
2008-05-22 13:27 paul Status new => resolved
2008-05-22 13:27 paul Resolution open => fixed
2008-05-22 13:27 paul Assigned To => paul
2008-05-22 13:27 paul Note Added: 0004958
2011-08-16 11:16 colinf Status resolved => closed