From: Tim Mayberry Date: Sat, 23 Jun 2012 05:08:17 +0000 (+0000) Subject: Make PBD::sys::exists_and_writable take a string instead of sys::path X-Git-Tag: 3.0~1062 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=878acbee14849b763d8c6eb035a151b444580158;p=ardour.git Make PBD::sys::exists_and_writable take a string instead of sys::path git-svn-id: svn://localhost/ardour2/branches/3.0@12864 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 1305653c54..d6dfd176ba 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -521,7 +521,7 @@ Session::create (const string& session_template, BusProfile* bus_profile) return -1; } - _writable = exists_and_writable (sys::path (_path)); + _writable = sys::exists_and_writable (_path); if (!session_template.empty()) { std::string in_path = session_template_dir_to_file (session_template); @@ -894,7 +894,7 @@ Session::load_state (string snapshot_name) set_dirty(); - _writable = exists_and_writable (xmlpath); + _writable = sys::exists_and_writable (xmlpath.to_string()); if (!state_tree->read (xmlpath.to_string())) { error << string_compose(_("Could not understand ardour file %1"), xmlpath.to_string()) << endmsg; diff --git a/libs/pbd/filesystem.cc b/libs/pbd/filesystem.cc index e2b8b37ba7..105af6ea32 100644 --- a/libs/pbd/filesystem.cc +++ b/libs/pbd/filesystem.cc @@ -94,7 +94,7 @@ exists (const path & p) } bool -exists_and_writable (const path & p) +exists_and_writable (const std::string & p) { /* writable() really reflects the whole folder, but if for any reason the session state file can't be written to, still @@ -103,7 +103,7 @@ exists_and_writable (const path & p) struct stat statbuf; - if (g_stat (p.to_string().c_str(), &statbuf) != 0) { + if (g_stat (p.c_str(), &statbuf) != 0) { /* doesn't exist - not writable */ return false; } else { diff --git a/libs/pbd/pbd/filesystem.h b/libs/pbd/pbd/filesystem.h index 74baaa3707..ee376df33a 100644 --- a/libs/pbd/pbd/filesystem.h +++ b/libs/pbd/pbd/filesystem.h @@ -121,7 +121,7 @@ bool exists(const path & p); /// @return true if path at p exists and is writable, false otherwise -bool exists_and_writable(const path & p); +bool exists_and_writable(const std::string & p); /// @return true if path at p is a directory. bool is_directory(const path & p);