summaryrefslogtreecommitdiff
path: root/gtk2_ardour/export_range_markers_dialog.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-04-15 14:41:38 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-04-15 14:41:38 +0000
commit5565078136e72c6c098fc4b4b688f6c1af58d069 (patch)
treedb7aa276be3e7b08480eda6bc1e1e5aee40c8af4 /gtk2_ardour/export_range_markers_dialog.cc
parent1d1de9b669a141954a252a1d0173ddc6348cba9c (diff)
remove a bunch of explicit uses of '/' as a directory separator; use Glib::build_filename() to construct more paths rather than doing it "by hand"; fixup small logic mistake (which had no actual consequences) in export track marker dialog
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6909 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/export_range_markers_dialog.cc')
-rw-r--r--gtk2_ardour/export_range_markers_dialog.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/gtk2_ardour/export_range_markers_dialog.cc b/gtk2_ardour/export_range_markers_dialog.cc
index 50b8098d60..5a04b25f86 100644
--- a/gtk2_ardour/export_range_markers_dialog.cc
+++ b/gtk2_ardour/export_range_markers_dialog.cc
@@ -110,22 +110,16 @@ ExportRangeMarkersDialog::process_range_markers_export(Locations::LocationList&
string
ExportRangeMarkersDialog::get_target_filepath(string path, string filename, string postfix)
{
- string target_path = path;
- if ((target_path.find_last_of ('/')) != string::npos) {
- target_path += '/';
- }
-
- string target_filepath = target_path + filename + postfix;
+ string target_filepath = Glib::build_filename (path, filename + postfix);
struct stat statbuf;
- for(int counter=1; (stat (target_filepath.c_str(), &statbuf) == 0); counter++){
+ for (int counter=1; Glib::file_test (target_filepath, Glib::FILE_TEST_EXISTS); counter++) {
// while file exists
ostringstream scounter;
scounter.flush();
scounter << counter;
- target_filepath =
- target_path + filename + "_" + scounter.str() + postfix;
+ target_filepath = Glib::build_filename (path, filename + "_" + scounter.str() + postfix);
}
return target_filepath;