13
0

fix renaming renamed session.

This commit is contained in:
Robin Gareus 2015-04-05 16:01:08 +02:00
parent 5694509bdf
commit 4b485332ce

View File

@ -3638,6 +3638,8 @@ Session::rename (const std::string& new_name)
* already exist ... * already exist ...
*/ */
vector<space_and_path> new_session_dirs;
for (vector<space_and_path>::const_iterator i = session_dirs.begin(); i != session_dirs.end(); ++i) { for (vector<space_and_path>::const_iterator i = session_dirs.begin(); i != session_dirs.end(); ++i) {
vector<string> v; vector<string> v;
@ -3660,6 +3662,11 @@ Session::rename (const std::string& new_name)
if (Glib::file_test (newstr, Glib::FILE_TEST_EXISTS)) { if (Glib::file_test (newstr, Glib::FILE_TEST_EXISTS)) {
return -1; return -1;
} }
space_and_path sp;
sp.path = newstr;
sp.blocks = 0; // not needed
new_session_dirs.push_back(sp);
} }
/* Session dirs */ /* Session dirs */
@ -3719,6 +3726,8 @@ Session::rename (const std::string& new_name)
} }
} }
session_dirs = new_session_dirs;
/* state file */ /* state file */
oldstr = Glib::build_filename (newpath, _current_snapshot_name) + statefile_suffix; oldstr = Glib::build_filename (newpath, _current_snapshot_name) + statefile_suffix;