13
0

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
This commit is contained in:
Tim Mayberry 2012-06-23 07:33:31 +00:00
parent e85f11618c
commit 9680af515c
2 changed files with 4 additions and 10 deletions

View File

@ -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 ()
*/

View File

@ -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