13
0

Remove limit parameter from PBD::find_files_matching_regex

This limit was not used or documented. The same functionality can be
performed when iterating through the results.
This commit is contained in:
Tim Mayberry 2014-06-19 13:24:34 +10:00 committed by Paul Davis
parent 0189ad7e29
commit 56337eade4
4 changed files with 5 additions and 9 deletions

View File

@ -2053,7 +2053,7 @@ AUPlugin::find_presets ()
user_preset_map.clear ();
find_files_matching_filter (preset_files, preset_search_path, au_preset_filter, this, true, true, -1, true);
find_files_matching_filter (preset_files, preset_search_path, au_preset_filter, this, true, true, true);
if (preset_files.empty()) {
return;

View File

@ -95,7 +95,7 @@ PannerManager::discover_panners ()
DEBUG_TRACE (DEBUG::Panning, string_compose (_("looking for panners in %1\n"), search_path));
find_files_matching_filter (panner_modules, search_path, panner_filter, 0, false, true, 1, true);
find_files_matching_filter (panner_modules, search_path, panner_filter, 0, false, true, true);
for (vector<std::string>::iterator i = panner_modules.begin(); i != panner_modules.end(); ++i) {
panner_discover (*i);

View File

@ -227,7 +227,7 @@ find_files_matching_regex (vector<string>& result,
find_files_matching_filter (result, dirpath,
regexp_filter, &compiled_pattern,
true, true, -1, false);
true, true, false);
regfree (&compiled_pattern);
}
@ -238,7 +238,6 @@ find_files_matching_filter (vector<string>& result,
bool (*filter)(const string &, void *),
void *arg,
bool match_fullpath, bool return_fullpath,
long limit,
bool recurse)
{
DIR *dir;
@ -277,7 +276,7 @@ find_files_matching_filter (vector<string>& result,
}
if (statbuf.st_mode & S_IFDIR && recurse) {
find_files_matching_filter (result, fullpath, filter, arg, match_fullpath, return_fullpath, limit, recurse);
find_files_matching_filter (result, fullpath, filter, arg, match_fullpath, return_fullpath, recurse);
} else {
if (match_fullpath) {
@ -295,13 +294,11 @@ find_files_matching_filter (vector<string>& result,
} else {
result.push_back(finfo->d_name);
}
nfound++;
}
}
closedir (dir);
} while ((limit < 0 || (nfound < limit)) && (thisdir = strtok_r (0, G_SEARCHPATH_SEPARATOR_S, &saveptr)));
} while ((thisdir = strtok_r (0, G_SEARCHPATH_SEPARATOR_S, &saveptr)));
free (pathcopy);
return;

View File

@ -127,7 +127,6 @@ find_files_matching_filter (std::vector<std::string>&,
void *arg,
bool match_fullpath,
bool return_fullpath,
long limit = -1,
bool recurse = false);
/**