]> git.saurik.com Git - wxWidgets.git/commitdiff
Have wxLaunchDefaultBrowser fallback to the BROWSER environment
authorRobin Dunn <robin@alldunn.com>
Tue, 10 May 2005 23:38:12 +0000 (23:38 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 10 May 2005 23:38:12 +0000 (23:38 +0000)
variable on *nix if the mimetype info fails to lead to a usable
command.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/utilscmn.cpp

index 977675ac1a7b898815395cc230bd50582a84d884..2468ed2c00163c3a8c9f00d3b68fb182b69e308c 100644 (file)
@@ -660,7 +660,13 @@ bool wxLaunchDefaultBrowser(const wxString& url)
         }
     }
     else
-        return false;
+    {
+        // fallback to checking for the BROWSER environment variable
+        cmd = wxGetenv(wxT("BROWSER"));
+        if ( cmd.empty() || wxExecute(cmd + wxT(" ") + finalurl) == -1)
+            return false;
+    }
+     
 
 #else // !wxUSE_MIMETYPE && !(WXMSW && wxUSE_NATIVE_CONFIG)