summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-06-25 00:34:13 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-06-25 00:34:13 +0000
commit4bf64d7d8c11bf3e2c7bc1b8fbb6c754372b2739 (patch)
treeba62f96ae44bfecd32b4fea63a2d955010492c59 /gtk2_ardour
parent3488b2fe094169456a4aff2f2b021a54b2db8254 (diff)
another part of the fix for cleanup: when successfully using link(2) to embed a file in the session, make sure to store its path as a relative rather than absolute path - this way it looks like a file that actually belongs to the session
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5269 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_audio_import.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index fa946f90c9..1b34d1e2a6 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -524,6 +524,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
string linked_path;
SoundFileInfo finfo;
int ret = 0;
+ Glib::ustring path_to_use;
track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
gdk_flush ();
@@ -537,6 +538,8 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
linked_path = session->sound_dir();
linked_path += '/';
linked_path += Glib::path_get_basename (path);
+
+ path_to_use = path;
if (link (path.c_str(), linked_path.c_str()) == 0) {
@@ -547,6 +550,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
*/
path = linked_path;
+ path_to_use = Glib::path_get_basename (linked_path);
} else {
@@ -558,6 +562,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
if (stat (linked_path.c_str(), &sb) == 0) {
if (sb.st_nlink > 1) { // its a hard link, assume its the one we want
path = linked_path;
+ path_to_use = Glib::path_get_basename (linked_path);
}
}
}
@@ -638,7 +643,7 @@ Editor::embed_sndfiles (vector<Glib::ustring> paths, bool multifile,
if ((s = session->source_by_path_and_channel (path, n)) == 0) {
source = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createReadable
- (*session, path, n,
+ (*session, path_to_use, n,
(mode == ImportAsTapeTrack ?
AudioFileSource::Destructive :
AudioFileSource::Flag (0)),