mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-17 09:07:41 +02:00
AUP3: Fix recovery for project without autosave or project docs
Also fixes a connection restoration issue that I can't believe didn't cause all manner of issues.
This commit is contained in:
parent
9f058dc308
commit
0dca04dc3b
@ -1797,16 +1797,17 @@ bool ProjectFileIO::LoadProject(const FilePath &fileName)
|
||||
// Error already set
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Missing both the autosave and project docs. This can happen if the
|
||||
// system were to crash before the first autosave into a temporary file.
|
||||
// This should be a recoverable scenario.
|
||||
if (buffer.GetDataLen() == 0)
|
||||
{
|
||||
SetError(XO("Unable to load project or autosave documents"));
|
||||
return false;
|
||||
mRecovered = true;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// Decode it while capturing the associated sample blockids
|
||||
project = ProjectSerializer::Decode(buffer, blockids);
|
||||
if (project.empty())
|
||||
@ -1843,6 +1844,7 @@ bool ProjectFileIO::LoadProject(const FilePath &fileName)
|
||||
{
|
||||
mRecovered = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Mark the project modified if we recovered it
|
||||
if (mRecovered)
|
||||
@ -1865,6 +1867,8 @@ bool ProjectFileIO::LoadProject(const FilePath &fileName)
|
||||
|
||||
DiscardConnection();
|
||||
|
||||
success = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user