diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index 5fe5a56205..e186f3712e 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -1019,12 +1019,12 @@ ExportDialog::start_export () string dir = session->export_dir(); string::size_type last_slash; - if ((last_slash = dir.find_last_of ('/')) != string::npos && last_slash != 0) { + if ((last_slash = dir.find_last_of (G_DIR_SEPARATOR_S)) != string::npos && last_slash != 0) { dir = dir.substr (0, last_slash+1); } if (!wants_dir()) { - dir = dir + "export.wav"; + dir = dir + "export.wav"; // Glib::build_filename() ? } file_entry.set_text (dir); diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index ba90026740..919e9587fe 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -222,13 +222,7 @@ AudioFileSource::find_broken_peakfile (ustring peak_path, ustring audio_path) ustring AudioFileSource::broken_peak_path (ustring audio_path) { - ustring res; - - res = _session.peak_dir (); - res += PBD::basename_nosuffix (audio_path); - res += ".peak"; - - return res; + return Glib::build_filename(_session.peak_dir (), PBD::basename_nosuffix (audio_path) + ".peak"); } ustring diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 10b1e42328..ac5381b591 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -25,6 +25,7 @@ #include +#include #include #include @@ -1669,16 +1670,12 @@ IO::load_automation (string path) float version; LocaleGuard lg (X_("POSIX")); - fullpath = _session.automation_dir(); - fullpath += path; + fullpath = Glib::build_filename(_session.automation_dir(), path); in.open (fullpath.c_str()); if (!in) { - fullpath = _session.automation_dir(); - fullpath += _session.snap_name(); - fullpath += '-'; - fullpath += path; + fullpath = Glib::build_filename(_session.automation_dir(), _session.snap_name() + '-' + path); in.open (fullpath.c_str()); diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index eb9547edff..db802b0921 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -1155,8 +1155,7 @@ Panner::set_state (const XMLNode& node) /* automation path is relative */ - automation_path = _session.automation_dir(); - automation_path += prop->value (); + automation_path = Glib::build_filename(_session.automation_dir(), prop->value ()); } return 0; @@ -1324,11 +1323,8 @@ Panner::set_position (float xpos, float ypos, float zpos, StreamPanner& orig) void Panner::set_name (string str) { - automation_path = _session.automation_dir(); - automation_path += _session.snap_name(); - automation_path += "-pan-"; - automation_path += legalize_for_path (str); - automation_path += ".automation"; + automation_path = Glib::build_filename(_session.automation_dir(), + _session.snap_name() + "-pan-" + legalize_for_path (str) + ".automation"); } int diff --git a/libs/ardour/redirect.cc b/libs/ardour/redirect.cc index b1e631015f..afb166b8cb 100644 --- a/libs/ardour/redirect.cc +++ b/libs/ardour/redirect.cc @@ -26,6 +26,8 @@ #include +#include + #include #include @@ -342,8 +344,7 @@ Redirect::load_automation (string path) if (path[0] == '/') { // legacy fullpath = path; } else { - fullpath = _session.automation_dir(); - fullpath += path; + fullpath = Glib::build_filename(_session.automation_dir(), path); } ifstream in (fullpath.c_str()); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index b11ed56a6e..2a10773d09 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2970,13 +2970,7 @@ Session::source_by_path_and_channel (const Glib::ustring& path, uint16_t chn) Glib::ustring Session::peak_path (Glib::ustring base) const { - Glib::ustring res; - - res = peak_dir (); - res += base; - res += ".peak"; - - return res; + return Glib::build_filename(peak_dir (), base + ".peak"); } string