summary refs log tree commit diff stats
path: root/src/fe-gtk
diff options
context:
space:
mode:
authorTingPing <tngpng@gmail.com>2013-04-27 15:30:40 -0300
committerTingPing <tngpng@gmail.com>2013-04-27 15:30:40 -0300
commitffce6c57880f9aa60fc309e59b28b8472747f94e (patch)
tree1ffdeb8524f1a7c99acad08cbcad67194a956c46 /src/fe-gtk
parent565a4927242ad84430b247f3e3939cf75ceb986d (diff)
Clean up old url handling on unix
Diffstat (limited to 'src/fe-gtk')
-rw-r--r--src/fe-gtk/fe-gtk.c58
1 files changed, 1 insertions, 57 deletions
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c
index 72794fe5..fc3737fb 100644
--- a/src/fe-gtk/fe-gtk.c
+++ b/src/fe-gtk/fe-gtk.c
@@ -973,34 +973,6 @@ fe_set_inputbox_contents (session *sess, char *text)
 	}
 }
 
-#ifndef WIN32
-
-static gboolean
-try_browser (const char *browser, char *arg, const char *url)
-{
-	char *argv[4];
-	char *path;
-
-	path = g_find_program_in_path (browser);
-	if (!path)
-		return 0;
-
-	argv[0] = path;
-	argv[1] = (char *)url;
-	argv[2] = NULL;
-	if (arg)
-	{
-		argv[1] = arg;
-		argv[2] = (char *)url;
-		argv[3] = NULL;
-	}
-	hexchat_execv (argv);
-	g_free (path);
-	return 1;
-}
-
-#endif
-
 static void
 fe_open_url_inner (const char *url)
 {
@@ -1009,35 +981,7 @@ fe_open_url_inner (const char *url)
 #elif defined __APPLE__
 	try_browser ("open", NULL, url);				/* on Mac you can just 'open http://foo.bar/' */
 #else
-
-	/* lets try what gtk has built in first. */
-	if (gtk_show_uri (NULL, url, GDK_CURRENT_TIME, NULL))
-		return;
-		
-	/* universal desktop URL opener (from xdg-utils). Supports gnome,kde,xfce4. */
-	if (try_browser ("xdg-open", NULL, url))
-		return;
-
-	/* try to detect GNOME (this env variable is depreciated) */
-	if (g_getenv ("GNOME_DESKTOP_SESSION_ID"))
-	{
-		if (try_browser ("gvfs-open", NULL, url))
-			return;
-	}
-
-	/* try to detect KDE */
-	if (g_getenv ("KDE_FULL_SESSION"))
-	{
-		if (try_browser ("kde-open", NULL, url))
-			return;
-	}
-
-	/* everything failed, what now? just try firefox */
-	if (try_browser ("firefox", NULL, url))
-		return;
-
-	/* fresh out of ideas... i hear chromium is popular */
-	try_browser ("chromium", NULL, url);
+	gtk_show_uri (NULL, url, GDK_CURRENT_TIME, NULL);
 #endif
 }