Rename PBD::find_file_in_search_path to just PBD::find_file

saves a bit of typing and not necessary if you look at how it is used.
This commit is contained in:
Tim Mayberry
2014-06-19 21:23:12 +10:00
committed by Paul Davis
parent 8d0cba3384
commit cd12698b9c
28 changed files with 45 additions and 45 deletions

View File

@@ -116,7 +116,7 @@ PluginManager::PluginManager ()
string lrdf_path;
string scan_p = Glib::build_filename(ARDOUR::ardour_dll_directory(), "fst");
if (!PBD::find_file_in_search_path ( PBD::Searchpath(scan_p), "ardour-vst-scanner", scanner_bin_path)) {
if (!PBD::find_file ( PBD::Searchpath(scan_p), "ardour-vst-scanner", scanner_bin_path)) {
PBD::warning << "VST scanner app (ardour-vst-scanner) not found in path " << scan_p << endmsg;
}

View File

@@ -76,7 +76,7 @@ RCConfiguration::load_state ()
/* load system configuration first */
if (find_file_in_search_path (ardour_config_search_path(), "ardour_system.rc", rcfile)) {
if (find_file (ardour_config_search_path(), "ardour_system.rc", rcfile)) {
/* stupid XML Parser hates empty files */
@@ -104,7 +104,7 @@ RCConfiguration::load_state ()
/* now load configuration file for user */
if (find_file_in_search_path (ardour_config_search_path(), "ardour.rc", rcfile)) {
if (find_file (ardour_config_search_path(), "ardour.rc", rcfile)) {
/* stupid XML parser hates empty files */

View File

@@ -34,7 +34,7 @@ static char *vfork_exec_wrapper_path() {
return NULL;
#else
std::string vfork_exec_wrapper;
if (!PBD::find_file_in_search_path (
if (!PBD::find_file (
PBD::Searchpath(Glib::build_filename(ARDOUR::ardour_dll_directory(), "vfork")),
"ardour-exec-wrapper", vfork_exec_wrapper)) {
PBD::warning << "vfork exec wrapper not found..'" << endmsg;

View File

@@ -19,7 +19,7 @@ ResampledSourceTest::seekTest ()
std::string test_file_path;
const string test_filename = "test.wav";
CPPUNIT_ASSERT (find_file_in_search_path (test_search_path (), test_filename, test_file_path));
CPPUNIT_ASSERT (find_file (test_search_path (), test_filename, test_file_path));
boost::shared_ptr<SndFileImportableSource> s (new SndFileImportableSource (test_file_path));
ResampledImportableSource r (s, 48000, SrcBest);

View File

@@ -132,7 +132,7 @@ AlsaAudioBackend::acquire_device(const char* device_name)
_reservation_succeeded = false;
std::string request_device_exe;
if (!PBD::find_file_in_search_path (
if (!PBD::find_file (
PBD::Searchpath(Glib::build_filename(ARDOUR::ardour_dll_directory(), "ardouralsautil")
+ G_SEARCHPATH_SEPARATOR_S + ARDOUR::ardour_dll_directory()),
"ardour-request-device", request_device_exe))

View File

@@ -134,7 +134,7 @@ StatefulImage::find_image (const std::string& name)
std::string path;
if (!find_file_in_search_path (_image_search_path, name, path)) {
if (!find_file (_image_search_path, name, path)) {
error << string_compose (_("Image named %1 not found"),
name) << endmsg;
return ImageHandle();

View File

@@ -147,9 +147,9 @@ find_files_matching_pattern (vector<string>& result,
}
bool
find_file_in_search_path(const Searchpath& search_path,
const string& filename,
std::string& result)
find_file (const Searchpath& search_path,
const string& filename,
std::string& result)
{
vector<std::string> tmp;

View File

@@ -90,15 +90,15 @@ find_files_matching_pattern (std::vector<std::string>& result,
const std::string& pattern);
/**
* Takes a search path and a file name and place the full path
* Takes a search path and a file name and places the full path
* to that file in result if it is found within the search path.
*
* @return true If file is found within the search path.
*/
LIBPBD_API bool
find_file_in_search_path (const Searchpath& search_path,
const std::string& filename,
std::string& result);
find_file (const Searchpath& search_path,
const std::string& filename,
std::string& result);
/**

View File

@@ -195,7 +195,7 @@ SystemExec::SystemExec (std::string command, const std::map<char, std::string> s
{
init ();
make_argp_escaped(command, subs);
if (!find_file_in_search_path (Searchpath (Glib::getenv ("PATH")), argp[0], cmd)) {
if (!find_file (Searchpath (Glib::getenv ("PATH")), argp[0], cmd)) {
// not found in path - use as-is
cmd = argp[0];
}

View File

@@ -18,7 +18,7 @@ XPathTest::testMisc ()
// cout << "Test 1: RosegardenPatchFile.xml: Find all banks in the file" << endl;
std::string testdata_path;
CPPUNIT_ASSERT (find_file_in_search_path (test_search_path (), "RosegardenPatchFile.xml", testdata_path));
CPPUNIT_ASSERT (find_file (test_search_path (), "RosegardenPatchFile.xml", testdata_path));
XMLTree doc(testdata_path);
// "//bank" gives as last element an empty element libxml bug????
@@ -51,7 +51,7 @@ XPathTest::testMisc ()
// We have to allocate a new document here, or we get segfaults
std::string testsession_path;
CPPUNIT_ASSERT (find_file_in_search_path (test_search_path (), "TestSession.ardour", testsession_path));
CPPUNIT_ASSERT (find_file (test_search_path (), "TestSession.ardour", testsession_path));
XMLTree doc2(testsession_path);
result = doc2.find("/Session/Sources/Source[contains(@captured-for, 'Guitar')]");
@@ -77,7 +77,7 @@ XPathTest::testMisc ()
// cout << endl << endl << "Test 5: ProtoolsPatchFile.midnam: Get Banks and Patches for 'Name Set 1'" << endl;
std::string testmidnam_path;
CPPUNIT_ASSERT (find_file_in_search_path (test_search_path (), "ProtoolsPatchFile.midnam", testmidnam_path));
CPPUNIT_ASSERT (find_file (test_search_path (), "ProtoolsPatchFile.midnam", testmidnam_path));
// We have to allocate a new document here, or we get segfaults
XMLTree doc3(testmidnam_path);

View File

@@ -205,7 +205,7 @@ OSC::start ()
std::string url_file;
if (find_file_in_search_path (ardour_config_search_path(), "osc_url", url_file)) {
if (find_file (ardour_config_search_path(), "osc_url", url_file)) {
_osc_url_file = url_file;
ofstream urlfile;