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:
parent
91ddbf6a7c
commit
e5aee5adf6
1 changed files with 3 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue