- cerr << "Checking into " << str << " using " << template_suffix << endl;
- return (str.length() > strlen(template_suffix) &&
- str.find (template_suffix) == (str.length() - strlen (template_suffix)));
+ if (!Glib::file_test (str, Glib::FILE_TEST_IS_DIR)) {
+ return false;
+ }
+
+ return true;
+}
+
+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 ();