mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
Bug1521 residual: Save new project, still must remove project* folder
This commit is contained in:
parent
0cb89a895a
commit
5392feefd4
@ -404,7 +404,8 @@ void DirManager::CleanTempDir()
|
||||
|
||||
// static
|
||||
void DirManager::CleanDir(
|
||||
const wxString &path, const wxString &dirSpec, const wxString &msg)
|
||||
const wxString &path, const wxString &dirSpec, const wxString &msg,
|
||||
bool removeTop)
|
||||
{
|
||||
if (dontDeleteTempFiles)
|
||||
return; // do nothing
|
||||
@ -416,9 +417,12 @@ void DirManager::CleanDir(
|
||||
int countFiles =
|
||||
RecursivelyEnumerate(path, filePathArray, dirSpec, true, false);
|
||||
int countDirs =
|
||||
RecursivelyEnumerate(path, dirPathArray, dirSpec, false, true) - 1;
|
||||
RecursivelyEnumerate(path, dirPathArray, dirSpec, false, true);
|
||||
if (!removeTop) {
|
||||
// Remove the globaltemp itself from the array
|
||||
--countDirs;
|
||||
dirPathArray.resize(countDirs);
|
||||
}
|
||||
|
||||
auto count = countFiles + countDirs;
|
||||
if (count == 0)
|
||||
@ -547,7 +551,8 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const
|
||||
// recurse depth-first and rmdir every directory seen in old and
|
||||
// NEW; rmdir will fail on non-empty dirs.
|
||||
|
||||
CleanDir(cleanupLoc1, wxEmptyString, _("Cleaning up cache directories"));
|
||||
CleanDir(
|
||||
cleanupLoc1, wxEmptyString, _("Cleaning up cache directories"), true);
|
||||
|
||||
//This destroys the empty dirs of the OD block files, which are yet to come.
|
||||
//Dont know if this will make the project dirty, but I doubt it. (mchinen)
|
||||
|
@ -123,7 +123,8 @@ class PROFILE_DLL_API DirManager final : public XMLTagHandler {
|
||||
// program is exited normally.
|
||||
static void CleanTempDir();
|
||||
static void CleanDir(
|
||||
const wxString &path, const wxString &dirSpec, const wxString &msg);
|
||||
const wxString &path, const wxString &dirSpec, const wxString &msg,
|
||||
bool removeTop = false);
|
||||
|
||||
// Check the project for errors and possibly prompt user
|
||||
// bForceError: Always show log error alert even if no errors are found here.
|
||||
|
Loading…
x
Reference in New Issue
Block a user