1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 15:49:36 +02:00

Fix bug 160: silent blockfiles not copied between projects

This commit is contained in:
BusinessmanProgrammerSteve 2010-05-05 23:41:27 +00:00
parent 787d033f4c
commit d664740a88

View File

@ -839,6 +839,15 @@ BlockFile *DirManager::CopyBlockFile(BlockFile *b)
return b; return b;
} }
// Copy the blockfile
BlockFile *b2;
if (b->GetFileName().GetName().IsEmpty()) {
// Block files with no filename (i.e. SilentBlockFile) just need an
// in-memory copy
b2 = b->Copy(wxFileName());
}
else
{
wxFileName newFile = MakeBlockFileName(); wxFileName newFile = MakeBlockFileName();
// We assume that the new file should have the same extension // We assume that the new file should have the same extension
@ -854,13 +863,14 @@ BlockFile *DirManager::CopyBlockFile(BlockFile *b)
return NULL; return NULL;
} }
BlockFile *b2 = b->Copy(newFile); b2 = b->Copy(newFile);
if (b2 == NULL) if (b2 == NULL)
return NULL; return NULL;
blockFileHash[newFile.GetName()]=b2; blockFileHash[newFile.GetName()]=b2;
aliasList.Add(newFile.GetFullPath()); aliasList.Add(newFile.GetFullPath());
}
return b2; return b2;
} }