summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2014-11-15 15:46:40 -0500
committercomex <comexk@gmail.com>2015-05-28 19:14:42 -0400
commita225426510fc25316b3868e8764893dff284e77e (patch)
tree675c90e5057f2bbd5d2758d560845531e4dff303 /Source/Core/DolphinWX/FrameTools.cpp
parent6ff3fcee597663066c966a54ee51aab7fa166cd9 (diff)
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 <regex>. 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.
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp10
1 files changed, 2 insertions, 8 deletions
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<std::string> 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);
}