X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f6dd276a801247045a9684b86b47d9d9d9a1979..e319bb30f7e88242f56144fcc279b57047566a6b:/src/common/utilscmn.cpp?ds=sidebyside diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index d06002274f..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,11 +876,18 @@ 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; wxString cmd; +#if wxUSE_MIMETYPE wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html")); if ( ft ) { @@ -882,6 +897,7 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) ok = ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(url)); delete ft; } +#endif // wxUSE_MIMETYPE if ( !ok || cmd.empty() ) {