* don’t allow to rename read-only sessions
* prevent periodic save (while rename is in progress)
* no renaming while actively recording (peak files
among other things will mess things up)
string const old_sources_root = _session_dir->sources_root();
+ if (!_writable || (_state_of_the_state & CannotSave)) {
+ error << _("Cannot rename read-only session.") << endmsg;
+ return 0; // don't show "messed up" warning
+ }
+ if (record_status() == Recording) {
+ error << _("Cannot rename session while recording") << endmsg;
+ return 0; // don't show "messed up" warning
+ }
+
+ StateProtector stp (this);
+
/* Rename:
* session directory