From a225426510fc25316b3868e8764893dff284e77e Mon Sep 17 00:00:00 2001 From: comex Date: Sat, 15 Nov 2014 15:46:40 -0500 Subject: Rewrite FileSearch and improve ScanDirectoryTree. - FileSearch is now just one function, and it converts the original glob into a regex on all platforms rather than relying on native Windows pattern matching on there and a complete hack elsewhere. It now supports recursion out of the box rather than manually expanding into a full list of directories in multiple call sites. - This adds a GCC >= 4.9 dependency due to older versions having outright broken . MSVC is fine with it. - ScanDirectoryTree returns the parent entry rather than filling parts of it in via reference. The count is now stored in the entry like it was for subdirectories. - .glsl file search is now done with DoFileSearch. - IOCTLV_READ_DIR now uses ScanDirectoryTree directly and sorts the results after replacements for better determinism. --- Source/Core/DolphinWX/FrameTools.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'Source/Core/DolphinWX/FrameTools.cpp') diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 47aecfef4b..04e31fbfaf 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -1966,15 +1966,9 @@ void CFrame::GameListChanged(wxCommandEvent& event) SConfig::GetInstance().m_ListDrives = event.IsChecked(); break; case IDM_PURGE_CACHE: - CFileSearch::XStringVector Directories; - Directories.push_back(File::GetUserPath(D_CACHE_IDX)); - CFileSearch::XStringVector Extensions; - Extensions.push_back("*.cache"); + std::vector rFilenames = DoFileSearch({"*.cache"}, {File::GetUserPath(D_CACHE_IDX)}); - CFileSearch FileSearch(Extensions, Directories); - const CFileSearch::XStringVector& rFilenames = FileSearch.GetFileNames(); - - for (auto& rFilename : rFilenames) + for (const std::string& rFilename : rFilenames) { File::Delete(rFilename); } -- cgit v1.2.3