diff pidgin/gtknotify.c @ 22208:c77098cebf23

Use xdg-open instead of gnome-open, if possible. We might want to use xdg-open on other DEs too, because apparently it knows about KDE and XFCE and things. We might even be able to get rid of our browser prefs tab on those too.
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 26 Jan 2008 16:17:36 +0000
parents d943df776c09
children 66914f306712
line wrap: on
line diff
--- a/pidgin/gtknotify.c	Sat Jan 26 03:53:18 2008 +0000
+++ b/pidgin/gtknotify.c	Sat Jan 26 16:17:36 2008 +0000
@@ -1058,7 +1058,12 @@
 	/* if they are running gnome, use the gnome web browser */
 	if (purple_running_gnome() == TRUE)
 	{
-		command = g_strdup_printf("gnome-open %s", escaped);
+		char *tmp = g_find_program_in_path("xdg-open");
+		if (tmp == NULL)
+			command = g_strdup_printf("gnome-open %s", escaped);
+		else
+			command = g_strdup_printf("xdg-open %s", escaped);
+		g_free(tmp);
 	}
 	else if (purple_running_osx() == TRUE)
 	{
@@ -1074,6 +1079,10 @@
 		else
 			command = g_strdup_printf("%s %s", web_browser, escaped);
 	}
+	else if (!strcmp(web_browser, "xdg-open"))
+	{
+		command = g_strdup_printf("xdg-open %s", escaped);
+	}
 	else if (!strcmp(web_browser, "gnome-open"))
 	{
 		command = g_strdup_printf("gnome-open %s", escaped);