diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-05-22 16:38:36 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-05-22 16:38:36 +0000 |
commit | eb8fa216c237d34f047d3fe0bf63198ad5a95da8 (patch) | |
tree | 748577233e9de9a36072a2fcc3df33cafef50ec3 | |
parent | 93664a2adac106c3a3bd0346816ef410f234fea4 (diff) |
more path-building fixes from colinf
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3388 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/export_dialog.cc | 4 | ||||
-rw-r--r-- | libs/ardour/audiofilesource.cc | 8 | ||||
-rw-r--r-- | libs/ardour/io.cc | 9 | ||||
-rw-r--r-- | libs/ardour/panner.cc | 10 | ||||
-rw-r--r-- | libs/ardour/redirect.cc | 5 | ||||
-rw-r--r-- | libs/ardour/session.cc | 8 |
6 files changed, 13 insertions, 31 deletions
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 <sigc++/bind.h> +#include <glibmm.h> #include <glibmm/thread.h> #include <pbd/xml++.h> @@ -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 <sigc++/bind.h> +#include <glibmm.h> + #include <pbd/xml++.h> #include <pbd/enumwriter.h> @@ -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 |