X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b1b531857cd17285816fcfd6a1a4cc623c6848b..e319bb30f7e88242f56144fcc279b57047566a6b:/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;