diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2012-06-23 07:33:31 +0000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2012-06-23 07:33:31 +0000 |
commit | 9680af515c6d5f0f33ccce17a1d4df29d9e359ea (patch) | |
tree | a674789c57085cc9703b94493815943eab1f0765 | |
parent | e85f11618cb4f242f3aab1bf75f713668a1c3237 (diff) |
Change the meaning of the return value in SessionDirectory::create
return true if the session directories were successfully created, not
if the session directory was previously invalid(new directory).
git-svn-id: svn://localhost/ardour2/branches/3.0@12907 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/ardour/session_directory.h | 4 | ||||
-rw-r--r-- | libs/ardour/session_directory.cc | 10 |
2 files changed, 4 insertions, 10 deletions
diff --git a/libs/ardour/ardour/session_directory.h b/libs/ardour/ardour/session_directory.h index 3f6d5d5e7c..6f8f24386f 100644 --- a/libs/ardour/ardour/session_directory.h +++ b/libs/ardour/ardour/session_directory.h @@ -96,8 +96,8 @@ public: /** * Create the session directory and all the subdirectories. * - * @return true If a new session directory was created, otherwise - * (if it already existed) false. + * @return true If a new session directory and subdirectories were + * created, otherwise false. * * @post is_valid () */ diff --git a/libs/ardour/session_directory.cc b/libs/ardour/session_directory.cc index f0d928ff0e..5f3e984955 100644 --- a/libs/ardour/session_directory.cc +++ b/libs/ardour/session_directory.cc @@ -50,22 +50,16 @@ SessionDirectory::operator= (const std::string& newpath) bool SessionDirectory::create () { - bool is_new = false; - vector<std::string> sub_dirs = sub_directories (); for (vector<std::string>::const_iterator i = sub_dirs.begin(); i != sub_dirs.end(); ++i) { - if (Glib::file_test (*i, Glib::FILE_TEST_EXISTS)) { - is_new = false; - } - if (g_mkdir_with_parents (i->c_str(), 0755) != 0) { PBD::error << string_compose(_("Cannot create Session directory at path %1 Error: %2"), *i, g_strerror(errno)) << endmsg; - + return false; } } - return is_new; + return true; } bool |