From cf3ba227f7112b6ba0ab33f4b08b1432a7d4c368 Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Fri, 9 Jul 2010 03:52:51 +0000 Subject: [PATCH] Further work on bug 137. Accidental click OK on prev commit, so here are comments for it and this one: * Make progress messages not have ellipsis at end, as convention in other cases. * Reword "Continue without deleting" radio button about orphan files. * Fix the removal of empty dirs at the end of DirManager::ProjectFSCK() which previously did nothing because it passed a hardcoded zero count for the file list, to what is now RecursivelyRemove(). Added RecursivelyCountSubdirs() so progress dialog has correct maximum (directory count, not blockCount as previously). Added RecursivelyRemoveEmptyDirs(). * Found that Windows SDK functions sometimes do not remove empty directories and added code to help it in some cases. --- src/DirManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/DirManager.cpp b/src/DirManager.cpp index 0714fea14..ed49af952 100644 --- a/src/DirManager.cpp +++ b/src/DirManager.cpp @@ -304,10 +304,10 @@ static int RecursivelyRemoveEmptyDirs(wxString dirPath, // and RemoveDirectory), and they all give same results. // I noticed dirs get deleted in RecursivelyRemove, maybe because it doesn't // consider whether the path is a directory or a file and wxRemoveFile()'s it first. - // Tried it here, but no joy! - // #ifdef __WXMSW__ - // ::wxRemoveFile(dirPath); - // #endif + // Tried it here on WinXP, but no joy. Leave the code in case it works on other Win systems. + #ifdef __WXMSW__ + ::wxRemoveFile(dirPath); + #endif ::wxRmdir(dirPath); } nCount++; // Count dirPath in progress.