Patch from Tim Mayberry:
[ardour.git] / libs / ardour / session_directory.cc
index 1948a5a9b98655a1308c9f9efa1ceff7c20d6158..9653a15ae10b07c60f036ca5f7b9fe628e640000 100644 (file)
@@ -37,6 +37,13 @@ SessionDirectory::SessionDirectory (const path& session_path)
 
 }
 
+SessionDirectory& 
+SessionDirectory::operator= (const std::string& newpath)
+{
+       m_root_path = newpath;
+       return *this;
+}
+
 bool
 SessionDirectory::create ()
 {
@@ -87,7 +94,13 @@ SessionDirectory::old_sound_path () const
 const path
 SessionDirectory::sources_root () const
 {
-       const string legalized_root(legalize_for_path(m_root_path.leaf()));
+       path p = m_root_path;
+
+       if (p.leaf() == ".") {
+               p = PBD::sys::get_absolute_path (m_root_path);
+       }
+       
+       const string legalized_root (legalize_for_path (p.leaf ()));
 
        return m_root_path / interchange_dir_name / legalized_root;
 }
@@ -101,27 +114,12 @@ SessionDirectory::sound_path () const
        return sources_root() / sound_dir_name;
 }
 
-const path
-SessionDirectory::sound_stub_path () const
-{
-       if(is_directory (old_sound_path ())) return old_sound_path();
-
-       // the new style sound directory
-       return sources_root() / sound_dir_name / stub_dir_name;
-}
-
 const path
 SessionDirectory::midi_path () const
 {
        return sources_root() / midi_dir_name;
 }
 
-const path
-SessionDirectory::midi_stub_path () const
-{
-       return sources_root() / midi_dir_name / stub_dir_name;
-}
-
 const path
 SessionDirectory::midi_patch_path () const
 {