mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 16:40:07 +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
|
// Error already set
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Missing both the autosave and project docs. This can happen if the
|
// Missing both the autosave and project docs. This can happen if the
|
||||||
// system were to crash before the first autosave into a temporary file.
|
// system were to crash before the first autosave into a temporary file.
|
||||||
|
// This should be a recoverable scenario.
|
||||||
if (buffer.GetDataLen() == 0)
|
if (buffer.GetDataLen() == 0)
|
||||||
{
|
{
|
||||||
SetError(XO("Unable to load project or autosave documents"));
|
mRecovered = true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
// Decode it while capturing the associated sample blockids
|
// Decode it while capturing the associated sample blockids
|
||||||
project = ProjectSerializer::Decode(buffer, blockids);
|
project = ProjectSerializer::Decode(buffer, blockids);
|
||||||
if (project.empty())
|
if (project.empty())
|
||||||
@ -1843,6 +1844,7 @@ bool ProjectFileIO::LoadProject(const FilePath &fileName)
|
|||||||
{
|
{
|
||||||
mRecovered = true;
|
mRecovered = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Mark the project modified if we recovered it
|
// Mark the project modified if we recovered it
|
||||||
if (mRecovered)
|
if (mRecovered)
|
||||||
@ -1865,6 +1867,8 @@ bool ProjectFileIO::LoadProject(const FilePath &fileName)
|
|||||||
|
|
||||||
DiscardConnection();
|
DiscardConnection();
|
||||||
|
|
||||||
|
success = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user