]> git.saurik.com Git - wxWidgets.git/commitdiff
Prepend file:// if the URI in wxLaunchDefaultBrowser()
authorRobert Roebling <robert@roebling.de>
Sat, 19 May 2007 12:38:34 +0000 (12:38 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 19 May 2007 12:38:34 +0000 (12:38 +0000)
    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

src/common/utilscmn.cpp

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