From 3f133811fb36b54426f05d7b1498fe2a3606abc8 Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Thu, 1 Jul 2010 21:40:29 +0000 Subject: [PATCH] Get rid of AutoSaveEnabled pref altogether. AutoSave doesn't copy any audio data, so there's no reason to turn it off. --- src/Project.cpp | 23 ++++++----------------- src/Project.h | 1 - src/prefs/ProjectsPrefs.cpp | 8 -------- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/Project.cpp b/src/Project.cpp index 6b1e8c3a2..236226c78 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -3536,15 +3536,13 @@ void AudacityProject::PushState(wxString desc, if (GetTracksFitVerticallyZoomed()) this->DoZoomFitV(); - if (IsAutoSaveEnabled()) - AutoSave(); + AutoSave(); } void AudacityProject::ModifyState() { mUndoManager.ModifyState(mTracks, mViewInfo.sel0, mViewInfo.sel1); - if (IsAutoSaveEnabled()) - AutoSave(); + AutoSave(); } // LL: Is there a memory leak here as "l" and "t" are not deleted??? @@ -3601,8 +3599,7 @@ void AudacityProject::PopState(TrackList * l) this->UpdateMixerBoard(); #endif - if (IsAutoSaveEnabled()) - AutoSave(); + AutoSave(); } void AudacityProject::SetStateTo(unsigned int n) @@ -4262,13 +4259,6 @@ void AudacityProject::ReleaseKeyboard(wxWindow *w) } } -// static -bool AudacityProject::IsAutoSaveEnabled() -{ - bool autoSaveEnabled = true; - gPrefs->Read(wxT("/Directories/AutoSaveEnabled"), &autoSaveEnabled); - return autoSaveEnabled; -} void AudacityProject::AutoSave() { @@ -4380,7 +4370,7 @@ void AudacityProject::OnAudioIOStartRecording() // since no block files are written during recording that could be // recovered. // - if (IsAutoSaveEnabled() && !GetCacheBlockFiles()) + if (!GetCacheBlockFiles()) AutoSave(); } @@ -4391,14 +4381,13 @@ void AudacityProject::OnAudioIOStopRecording() mDirManager->WriteCacheToDisk(); // Now we auto-save again to get the project to a "normal" state again. - if (IsAutoSaveEnabled()) - AutoSave(); + AutoSave(); } void AudacityProject::OnAudioIONewBlockFiles(const wxString& blockFileLog) { // New blockfiles have been created, so add them to the auto-save file - if (IsAutoSaveEnabled() && !GetCacheBlockFiles() && + if (!GetCacheBlockFiles() && !mAutoSaveFileName.IsEmpty()) { wxFFile f(mAutoSaveFileName, wxT("at")); diff --git a/src/Project.h b/src/Project.h index 7d9621365..22aeb0eeb 100644 --- a/src/Project.h +++ b/src/Project.h @@ -409,7 +409,6 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame, void GetRegionsByLabel( Regions ®ions ); void AutoSave(); - static bool IsAutoSaveEnabled(); void DeleteCurrentAutoSaveFile(); static bool GetCacheBlockFiles(); diff --git a/src/prefs/ProjectsPrefs.cpp b/src/prefs/ProjectsPrefs.cpp index 8b7e58056..d80d72c0c 100644 --- a/src/prefs/ProjectsPrefs.cpp +++ b/src/prefs/ProjectsPrefs.cpp @@ -68,14 +68,6 @@ void ProjectsPrefs::PopulateOrExchange(ShuttleGui & S) S.EndRadioButtonGroup(); } S.EndStatic(); - - S.StartStatic(_("Auto save")); - { - S.TieCheckBox(_("Auto &save a copy of the project in a separate folder"), - wxT("/Directories/AutoSaveEnabled"), - true); - } - S.EndStatic(); } bool ProjectsPrefs::Apply()