mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-24 07:27:44 +01:00
make PBD's path-scanner OS agnostic (use glib)
This commit is contained in:
parent
35272b8c47
commit
ce32d5f17b
2 changed files with 3 additions and 13 deletions
|
|
@ -106,7 +106,7 @@ PathScanner::run_scan_internal (vector<string *> *result,
|
|||
string *newstr;
|
||||
long nfound = 0;
|
||||
|
||||
if ((thisdir = strtok (pathcopy, ":")) == 0 ||
|
||||
if ((thisdir = strtok (pathcopy, G_SEARCHPATH_SEPARATOR_S)) == 0 ||
|
||||
strlen (thisdir) == 0) {
|
||||
free (pathcopy);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -25,16 +25,6 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
namespace {
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
const char * const path_delimiter = ";";
|
||||
#else
|
||||
const char * const path_delimiter = ":";
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
namespace PBD {
|
||||
|
||||
Searchpath::Searchpath ()
|
||||
|
|
@ -46,7 +36,7 @@ Searchpath::Searchpath (const string& path)
|
|||
{
|
||||
vector<std::string> tmp;
|
||||
|
||||
if (tokenize (path, string(path_delimiter), std::back_inserter (tmp))) {
|
||||
if (tokenize (path, string(G_SEARCHPATH_SEPARATOR_S), std::back_inserter (tmp))) {
|
||||
add_directories (tmp);
|
||||
}
|
||||
}
|
||||
|
|
@ -79,7 +69,7 @@ Searchpath::to_string () const
|
|||
|
||||
for (vector<std::string>::const_iterator i = begin(); i != end(); ++i) {
|
||||
path += *i;
|
||||
path += path_delimiter;
|
||||
path += G_SEARCHPATH_SEPARATOR;
|
||||
}
|
||||
|
||||
path = path.substr (0, path.length() - 1); // drop final separator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue