Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 436536 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/fe-gtk/fe-gtk.c (-2 / +12 lines)
Lines 938-955 try_browser (const char *browser, const char *arg, const char *url) Link Here
938
static void
938
static void
939
fe_open_url_inner (const char *url)
939
fe_open_url_inner (const char *url)
940
{
940
{
941
	char buf[256];
942
941
#ifdef WIN32
943
#ifdef WIN32
942
	ShellExecute (0, "open", url, NULL, NULL, SW_SHOWNORMAL);
944
	ShellExecute (0, "open", url, NULL, NULL, SW_SHOWNORMAL);
943
#else
945
#else
944
	/* universal desktop URL opener (from xdg-utils). Supports gnome,kde,xfce4. */
946
	/* universal desktop URL opener (from xdg-utils). Supports gnome,kde,xfce4. */
945
	if (try_browser ("xdg-open", NULL, url))
947
	if (try_browser ("xdg-open", NULL, url))
946
		return;
948
		return;
949
	fprintf( stderr, "fe_open_url_inner: failed to open %s with xdg-open\n", url );
947
950
948
	/* try to detect GNOME */
951
	/* try to detect GNOME */
949
	if (g_getenv ("GNOME_DESKTOP_SESSION_ID"))
952
	if (g_getenv ("GNOME_DESKTOP_SESSION_ID"))
950
	{
953
	{
951
		if (try_browser ("gnome-open", NULL, url)) /* Gnome 2.4+ has this */
954
		if (try_browser ("gnome-open", NULL, url)) /* Gnome 2.4+ has this */
952
			return;
955
			return;
956
		fprintf( stderr, "fe_open_url_inner: failed to open %s with gnome-open\n", url );
953
	}
957
	}
954
958
955
	/* try to detect KDE */
959
	/* try to detect KDE */
Lines 957-970 fe_open_url_inner (const char *url) Link Here
957
	{
961
	{
958
		if (try_browser ("kfmclient", "exec", url))
962
		if (try_browser ("kfmclient", "exec", url))
959
			return;
963
			return;
964
		fprintf( stderr, "fe_open_url_inner: failed to open %s with kfmclient\n", url );
960
	}
965
	}
961
966
962
	/* everything failed, what now? just try firefox */
967
	/* everything failed, what now? just try firefox */
963
	if (try_browser ("firefox", NULL, url))
968
	if (try_browser ("firefox", NULL, url))
964
		return;
969
		return;
970
	fprintf( stderr, "fe_open_url_inner: failed to open %s with firefox\n", url );
971
972
	if (try_browser ("mozilla", NULL, url))
973
		return;
974
	fprintf( stderr, "fe_open_url_inner: failed to open %s with mozilla\n", url );
965
975
966
	/* fresh out of ideas... */
976
	/* fresh out of ideas... */
967
	try_browser ("mozilla", NULL, url);
977
	snprintf (buf, sizeof (buf), "Failed to open url:\n\n%s", url);
978
	fe_message (buf, FE_MSG_ERROR);
968
#endif
979
#endif
969
}
980
}
970
981
971
- 

Return to bug 436536