diff --git a/src/ProjectFileIO.cpp b/src/ProjectFileIO.cpp index 03c01c20d..7c9731873 100644 --- a/src/ProjectFileIO.cpp +++ b/src/ProjectFileIO.cpp @@ -185,7 +185,6 @@ auto ProjectFileIO::ReadProjectFile( const FilePath &fileName ) project.SetFileName( fileName ); mbLoadedFromAup = true; - mRecoveryAutoSaveDataDir = wxT(""); mIsRecovered = false; SetProjectTitle(); @@ -336,6 +335,9 @@ bool ProjectFileIO::HandleXMLTag(const wxChar *tag, const wxChar **attrs) int requiredTags = 0; long longVpos = 0; + // The auto-save data dir the project has been recovered from + FilePath recoveryAutoSaveDataDir; + // loop through attrs, which is a null-terminated list of // attribute-value pairs while(*attrs) { @@ -363,7 +365,7 @@ bool ProjectFileIO::HandleXMLTag(const wxChar *tag, const wxChar **attrs) { // Remember that this is a recovered project mIsRecovered = true; - mRecoveryAutoSaveDataDir = value; + recoveryAutoSaveDataDir = value; } } @@ -388,7 +390,7 @@ bool ProjectFileIO::HandleXMLTag(const wxChar *tag, const wxChar **attrs) // (which was lost by the crash) rather than the one in the // auto save folder wxFileName realFileDir; - realFileDir.AssignDir(mRecoveryAutoSaveDataDir); + realFileDir.AssignDir(recoveryAutoSaveDataDir); realFileDir.RemoveLastDir(); wxString realFileName = value; @@ -403,7 +405,7 @@ bool ProjectFileIO::HandleXMLTag(const wxChar *tag, const wxChar **attrs) // A previously unsaved project has been recovered, so fake // an unsaved project. The data files just stay in the temp // directory - dirManager.SetLocalTempDir(mRecoveryAutoSaveDataDir); + dirManager.SetLocalTempDir(recoveryAutoSaveDataDir); project.SetFileName( wxT("") ); projName = wxT(""); projPath = wxT(""); @@ -950,7 +952,6 @@ bool ProjectFileIO::DoSave (const bool fromSaveAs, // Before we saved this, this was a recovered project, but now it is // a regular project, so remember this. mIsRecovered = false; - mRecoveryAutoSaveDataDir = wxT(""); SetProjectTitle(); } else if (fromSaveAs) diff --git a/src/ProjectFileIO.h b/src/ProjectFileIO.h index 82d6f0979..cb730d3ad 100644 --- a/src/ProjectFileIO.h +++ b/src/ProjectFileIO.h @@ -101,9 +101,6 @@ private: // Last auto-save file name and path (empty if none) FilePath mAutoSaveFileName; - // The auto-save data dir the project has been recovered from - FilePath mRecoveryAutoSaveDataDir; - // Are we currently auto-saving or not? bool mAutoSaving{ false };