Prepend file:// if the URI in wxLaunchDefaultBrowser()

has no scheme and the local file exists.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46122 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-05-19 12:38:34 +00:00
parent 7239c22f2b
commit d545f8030a

View File

@@ -692,7 +692,12 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags)
wxString url(urlOrig); wxString url(urlOrig);
wxURI uri(url); wxURI uri(url);
if ( !uri.HasScheme() ) if ( !uri.HasScheme() )
url.Prepend(wxT("http://")); {
if (wxFileExists(urlOrig))
url.Prepend( wxT("file://") );
else
url.Prepend(wxT("http://"));
}
#if defined(__WXMSW__) #if defined(__WXMSW__)