mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 17:10:55 +02:00
In case save of new project fails, clean up the _data directory
This commit is contained in:
parent
cbfde23e42
commit
8a762f95b6
@ -496,10 +496,15 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
|
|||||||
wxString cleanupLoc1=oldLoc;
|
wxString cleanupLoc1=oldLoc;
|
||||||
wxString cleanupLoc2=projFull;
|
wxString cleanupLoc2=projFull;
|
||||||
|
|
||||||
|
bool created = false;
|
||||||
|
|
||||||
if (bCreate) {
|
if (bCreate) {
|
||||||
if (!wxDirExists(projFull))
|
if (!wxDirExists(projFull)) {
|
||||||
if (!wxMkdir(projFull))
|
if (!wxMkdir(projFull))
|
||||||
return false;
|
return false;
|
||||||
|
else
|
||||||
|
created = true;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __UNIX__
|
#ifdef __UNIX__
|
||||||
chmod(OSFILENAME(projFull), 0775);
|
chmod(OSFILENAME(projFull), 0775);
|
||||||
@ -584,6 +589,14 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
|
|||||||
this->projPath = oldPath;
|
this->projPath = oldPath;
|
||||||
this->projName = oldName;
|
this->projName = oldName;
|
||||||
|
|
||||||
|
if (created)
|
||||||
|
CleanDir(
|
||||||
|
cleanupLoc2,
|
||||||
|
wxEmptyString,
|
||||||
|
wxEmptyString,
|
||||||
|
_("Cleaning up after failed save"),
|
||||||
|
kCleanTopDirToo);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user