mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 07:39:42 +02:00
AUP3: UP-15 - cannot update a project
At least the project file doesn't get deleted now.
This commit is contained in:
parent
4206e1ff6d
commit
0bea15077b
@ -266,7 +266,7 @@ bool ProjectFileManager::DoSave(const FilePath & fileName, const bool fromSaveAs
|
||||
|
||||
// Always save a backup of the original project file
|
||||
wxString safetyFileName;
|
||||
if (wxFileExists(fileName))
|
||||
if (fromSaveAs && wxFileExists(fileName))
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
safetyFileName = fileName + wxT("~");
|
||||
@ -303,11 +303,14 @@ bool ProjectFileManager::DoSave(const FilePath & fileName, const bool fromSaveAs
|
||||
wxICON_ERROR,
|
||||
&window);
|
||||
|
||||
if (wxFileExists(fileName))
|
||||
if (fromSaveAs)
|
||||
{
|
||||
wxRemoveFile(fileName);
|
||||
if (wxFileExists(fileName))
|
||||
{
|
||||
wxRemoveFile(fileName);
|
||||
}
|
||||
wxRename(safetyFileName, fileName);
|
||||
}
|
||||
wxRename(safetyFileName, fileName);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -330,7 +333,10 @@ bool ProjectFileManager::DoSave(const FilePath & fileName, const bool fromSaveAs
|
||||
// If we get here, saving the project was successful, so we can DELETE
|
||||
// the .bak file (because it now does not fit our block files anymore
|
||||
// anyway).
|
||||
wxRemoveFile(safetyFileName);
|
||||
if (!safetyFileName.empty())
|
||||
{
|
||||
wxRemoveFile(safetyFileName);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user