13
0

Fix the URI handling (for sfdb) for Windows

This forward ports Mixbus' 4eca3dea47 without additional code to correct
for old (Ardour2) URIs.

A2, used path2uri() which accumulated and left duplicate slashes in place,
eg. "file:////". Mixbus3 auto-corrected this on load in
AudioLibrary::search_members_and().
However sfdb libraries are not shared between major versions, so this
code does no need to be forward ported.
This commit is contained in:
Robin Gareus 2019-04-12 18:38:49 +02:00
parent 6cfb164d7c
commit c218b65d24
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -78,8 +78,13 @@ void
AudioLibrary::save_changes ()
{
#ifdef HAVE_LRDF
if (lrdf_export_by_source(src.c_str(), src.substr(5).c_str())) {
PBD::warning << string_compose(_("Could not open %1. Audio Library not saved"), src) << endmsg;
#ifdef PLATFORM_WINDOWS
string path = Glib::locale_from_utf8 (Glib::filename_from_uri(src));
#else
string path = Glib::filename_from_uri(src);
#endif
if (lrdf_export_by_source(src.c_str(), path.c_str())) {
PBD::warning << string_compose(_("Could not open %1. Audio Library not saved"), path) << endmsg;
}
#endif
}