X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f10ccf9e6b4e67e08a3d13cd06cb13f28be15f4f..17ede0b11d44bf02e09dce4f3e0e32d594458b0f:/src/common/utilscmn.cpp diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index daaa20101a..7cf1062a5f 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -855,11 +855,19 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) // (non-Mac, non-MSW) #ifdef __UNIX__ - if (wxTheApp->GetTraits()->GetDesktopEnvironment() == wxT("GNOME")) + + wxString desktop = wxTheApp->GetTraits()->GetDesktopEnvironment(); + + // GNOME and KDE desktops have some applications which should be always installed + // together with their main parts, which give us the + if (desktop == wxT("GNOME")) { wxArrayString errors; wxArrayString output; - long res = wxExecute( wxT("gconftool-2 --get /desktop/gnome/applications/browser/exec"), output, errors, wxEXEC_NODISABLE ); + + // gconf will tell us the path of the application to use as browser + long res = wxExecute( wxT("gconftool-2 --get /desktop/gnome/applications/browser/exec"), + output, errors, wxEXEC_NODISABLE ); if (res >= 0 && errors.GetCount() == 0) { wxString cmd = output[0]; @@ -868,6 +876,12 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) return true; } } + else if (desktop == wxT("KDE")) + { + // kfmclient directly opens the given URL + if (wxExecute(wxT("kfmclient openURL ") + url)) + return true; + } #endif bool ok = false;