summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/InputConfigDiag.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/InputConfigDiag.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/InputConfigDiag.cpp')
-rw-r--r--Source/Core/DolphinWX/InputConfigDiag.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/Core/DolphinWX/InputConfigDiag.cpp b/Source/Core/DolphinWX/InputConfigDiag.cpp
index 54efaad3d2..4101dcdbf5 100644
--- a/Source/Core/DolphinWX/InputConfigDiag.cpp
+++ b/Source/Core/DolphinWX/InputConfigDiag.cpp
@@ -172,18 +172,14 @@ void InputConfigDialog::UpdateProfileComboBox()
pname += PROFILES_PATH;
pname += m_config.profile_name;
- CFileSearch::XStringVector exts;
- exts.push_back("*.ini");
- CFileSearch::XStringVector dirs;
- dirs.push_back(pname);
- CFileSearch cfs(exts, dirs);
- const CFileSearch::XStringVector& sv = cfs.GetFileNames();
+ std::vector<std::string> sv = DoFileSearch({"*.ini"}, {pname});
wxArrayString strs;
- for (auto si = sv.cbegin(); si != sv.cend(); ++si)
+ for (const std::string& filename : sv)
{
- std::string str(si->begin() + si->find_last_of('/') + 1 , si->end() - 4) ;
- strs.push_back(StrToWxStr(str));
+ std::string base;
+ SplitPath(filename, nullptr, &base, nullptr);
+ strs.push_back(StrToWxStr(base));
}
for (GamepadPage* page : m_padpages)