#include <fstream>
#include <string>
#include <cerrno>
-
-
#include <cstdio> /* snprintf(3) ... grrr */
#include <cmath>
#include <unistd.h>
#include <glibmm.h>
#include <glibmm/thread.h>
+#include <boost/algorithm/string.hpp>
+
#include "midi++/mmc.h"
#include "midi++/port.h"
#include "midi++/manager.h"
string newstr;
bool first = true;
+ string const old_sources_root = _session_dir->sources_root().to_string ();
+
#define RENAME ::rename
/* Rename:
}
}
+ /* update file source paths */
+
+ for (SourceMap::iterator i = sources.begin(); i != sources.end(); ++i) {
+ boost::shared_ptr<FileSource> fs = boost::dynamic_pointer_cast<FileSource> (i->second);
+ if (fs) {
+ string p = fs->path ();
+ boost::replace_all (p, old_sources_root, _session_dir->sources_root().to_string ());
+ fs->set_path (p);
+ }
+ }
+
/* remove old name from recent sessions */
remove_recent_sessions (_path);