summaryrefslogtreecommitdiff
path: root/libs/pbd/file_utils.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2014-06-22 12:53:35 +1000
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-25 12:40:10 -0400
commit54c0a0144c726e51a3a43ccd91c86328b18c5087 (patch)
tree6e51953a3a8d8a65173448347d0fbcd2b1651e02 /libs/pbd/file_utils.cc
parente7141d2b80d544cce74e93e41c150e0bf7c848b2 (diff)
Use run_functor_for_paths in PBD::find_files_matching_filter
Diffstat (limited to 'libs/pbd/file_utils.cc')
-rw-r--r--libs/pbd/file_utils.cc38
1 files changed, 1 insertions, 37 deletions
diff --git a/libs/pbd/file_utils.cc b/libs/pbd/file_utils.cc
index 95a54c9a8b..9d7075e942 100644
--- a/libs/pbd/file_utils.cc
+++ b/libs/pbd/file_utils.cc
@@ -297,43 +297,7 @@ find_files_matching_filter (vector<string>& result,
bool match_fullpath, bool return_fullpath,
bool recurse)
{
- vector<string> all_files;
-
- for (vector<string>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
- string expanded_path = path_expand (*i);
- DEBUG_TRACE (DEBUG::FileUtils,
- string_compose("Find files in expanded path: %1\n", expanded_path));
- get_directory_contents (expanded_path, all_files, true, recurse);
- }
-
- for (vector<string>::iterator i = all_files.begin(); i != all_files.end(); ++i) {
-
- string fullpath = *i;
- string filename = Glib::path_get_basename (*i);
- string search_str;
-
- if (match_fullpath) {
- search_str = *i;
- } else {
- search_str = filename;
- }
-
- DEBUG_TRACE (DEBUG::FileUtils,
- string_compose("Filter using string: %1\n", search_str));
-
- if (!filter(search_str, arg)) {
- continue;
- }
-
- DEBUG_TRACE (DEBUG::FileUtils,
- string_compose("Found file %1 matching filter\n", search_str));
-
- if (return_fullpath) {
- result.push_back(fullpath);
- } else {
- result.push_back(filename);
- }
- }
+ run_functor_for_paths (result, paths, filter, arg, true, match_fullpath, return_fullpath, recurse);
}
bool