From 31c10bd86aa2ff632d8176dedf17a1180be7723e Mon Sep 17 00:00:00 2001 From: "james.k.crook" Date: Sat, 12 Feb 2011 14:37:00 +0000 Subject: [PATCH] Restore safety files (.bak) sooner. The aim is to be back in a good state before we show the error dialog. --- src/Project.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Project.cpp b/src/Project.cpp index 473ea020f..892ab6928 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -3051,6 +3051,8 @@ bool AudacityProject::Save(bool overwrite /* = true */ , bool success = false; if( !wxDir::Exists( projPath ) ){ + if (safetyFileName != wxT("")) + wxRename(safetyFileName, mFileName); wxMessageBox(wxString::Format( _("Could not save project. Path not found. Try creating \ndirectory \"%s\" before saving project with this name."), projPath.c_str()), @@ -3087,13 +3089,12 @@ bool AudacityProject::Save(bool overwrite /* = true */ , } if (!success) { + if (safetyFileName != wxT("")) + wxRename(safetyFileName, mFileName); wxMessageBox(wxString::Format(_("Could not save project. Perhaps %s \nis not writable or the disk is full."), project.c_str()), _("Error saving project"), wxICON_ERROR, this); - if (safetyFileName != wxT("")) - wxRename(safetyFileName, mFileName); - return false; } }