root_cache[m_root_path] = Glib::build_filename (sources_root_path, entries.front());
}
else if (entries.size() > 1) {
- PBD::open_uri (sources_root_path);
+ PBD::open_folder (sources_root_path);
PBD::fatal << string_compose (_("The session's interchange dir is tainted.\nThere is more than one folder in '%1'.\nPlease remove extra subdirs to reduce possible filename ambiguties."), sources_root_path) << endmsg;
assert (0); // not reached
}
#include "pbd/openuri.h"
#ifdef __APPLE__
+#include <curl/curl.h>
extern bool cocoa_open_url (const char*);
#endif
{
return open_uri (uri.c_str());
}
+
+bool
+PBD::open_folder (const std::string& d)
+{
+#ifdef __APPLE__
+ CURL *curl = curl_easy_init ();
+ if (curl) {
+ char * e = curl_easy_escape (curl, d.c_str(), d.size());
+ std::string url = "file:///" + std::string(e);
+ PBD::open_uri (url);
+ curl_free (e);
+ }
+#else
+ PBD::open_uri (d);
+#endif
+}
namespace PBD {
LIBPBD_API bool open_uri (const char*);
LIBPBD_API bool open_uri (const std::string&);
+ LIBPBD_API bool open_folder (const std::string&);
}
#endif