1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
## DP: added error handling, see #467458.
--- a/src/fe-gtk/fe-gtk.c
+++ b/src/fe-gtk/fe-gtk.c
@@ -934,18 +934,22 @@
static void
fe_open_url_inner (const char *url)
{
+ char buf[256];
+
#ifdef WIN32
ShellExecute (0, "open", url, NULL, NULL, SW_SHOWNORMAL);
#else
/* universal desktop URL opener (from xdg-utils). Supports gnome,kde,xfce4. */
if (try_browser ("xdg-open", NULL, url))
return;
+ fprintf( stderr, "fe_open_url_inner: failed to open %s with xdg-open\n", url );
/* try to detect GNOME */
if (g_getenv ("GNOME_DESKTOP_SESSION_ID"))
{
if (try_browser ("gnome-open", NULL, url)) /* Gnome 2.4+ has this */
return;
+ fprintf( stderr, "fe_open_url_inner: failed to open %s with gnome-open\n", url );
}
/* try to detect KDE */
@@ -953,14 +957,21 @@
{
if (try_browser ("kfmclient", "exec", url))
return;
+ fprintf( stderr, "fe_open_url_inner: failed to open %s with kfmclient\n", url );
}
/* everything failed, what now? just try firefox */
if (try_browser ("firefox", NULL, url))
return;
+ fprintf( stderr, "fe_open_url_inner: failed to open %s with firefox\n", url );
+
+ if (try_browser ("mozilla", NULL, url))
+ return;
+ fprintf( stderr, "fe_open_url_inner: failed to open %s with mozilla\n", url );
/* fresh out of ideas... */
- try_browser ("mozilla", NULL, url);
+ snprintf (buf, sizeof (buf), "Failed to open url:\n\n%s", url);
+ fe_message (buf, FE_MSG_ERROR);
#endif
}
|