Merge branch 'master' into cairocanvas
[ardour.git] / libs / ardour / template_utils.cc
index 3e4797dac1de8bbf361a531f07c11709e5481f4c..05007b0ade901f391425f4974079d7f1212e7e05 100644 (file)
@@ -1,9 +1,27 @@
+/*
+    Copyright (C) 2012 Paul Davis 
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
 #include <algorithm>
 #include <cstring>
 
 #include <glibmm.h>
 
-#include "pbd/filesystem.h"
 #include "pbd/basename.h"
 #include "pbd/pathscanner.h"
 #include "pbd/xml++.h"
@@ -35,22 +53,16 @@ route_template_search_path ()
        return spath;
 }
 
-sys::path
+std::string
 user_template_directory ()
 {
-       sys::path p(user_config_directory());
-       p /= templates_dir_name;
-
-       return p;
+       return Glib::build_filename (user_config_directory(), templates_dir_name);
 }
 
-sys::path
+std::string
 user_route_template_directory ()
 {
-       sys::path p(user_config_directory());
-       p /= route_templates_dir_name;
-       
-       return p;
+       return Glib::build_filename (user_config_directory(), route_templates_dir_name);
 }
 
 static bool
@@ -76,10 +88,7 @@ route_template_filter (const string &str, void */*arg*/)
 string
 session_template_dir_to_file (string const & dir)
 {
-       sys::path dir_path = dir;
-       sys::path file_path = dir;
-       file_path /= dir_path.leaf() + template_suffix;
-       return file_path.to_string ();
+       return Glib::build_filename (dir, Glib::path_get_basename(dir) + template_suffix);
 }