1
0
Fork 0

open-browser: always prefix paths with file://

Make opening a local file explicit as a URI, on all platforms (before,
this was only done on macOS)
This commit is contained in:
James Turner 2022-09-05 12:53:21 +01:00
parent 91ddbf6a7c
commit e5aee5adf6

View file

@ -180,10 +180,9 @@ bool openBrowser(const std::string& aAddress)
// resolve local file path
SGPath path(address);
path = globals->resolve_maybe_aircraft_path(address);
if (!path.isNull())
address = path.local8BitStr();
else
{
if (!path.isNull()) {
address = "file://" + path.local8BitStr();
} else {
mkDialog ("Sorry, file not found!");
SG_LOG(SG_GENERAL, SG_ALERT, "openBrowser: Cannot find requested file '"
<< address << "'.");
@ -192,10 +191,6 @@ bool openBrowser(const std::string& aAddress)
}
#ifdef SG_MAC
if (address.find("://")==string::npos) {
address = "file://" + address;
}
cocoaOpenUrl(address);
#elif defined _WIN32