Make PBD::sys::exists_and_writable take a string instead of sys::path
authorTim Mayberry <mojofunk@gmail.com>
Sat, 23 Jun 2012 05:08:17 +0000 (05:08 +0000)
committerTim Mayberry <mojofunk@gmail.com>
Sat, 23 Jun 2012 05:08:17 +0000 (05:08 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12864 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/session_state.cc
libs/pbd/filesystem.cc
libs/pbd/pbd/filesystem.h

index 1305653c54e088bd6f34fe633d59813b75877843..d6dfd176ba4ea72142d072220a1ca31dcc3bb81a 100644 (file)
@@ -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;
index e2b8b37ba78ab63830faa375e7d4fc23a4176117..105af6ea32c57cf10ab0875e5562a3f915a9ae18 100644 (file)
@@ -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 {
index 74baaa37073940e3ed037ea90efe60c7b0ff352e..ee376df33a2884fff5685d92f1bf477ba73e2607 100644 (file)
@@ -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);