im.pidgin.pidgin: 0f37c6a913d5207fa0fa327f5b11b215c7d35926

nosnilmot at pidgin.im nosnilmot at pidgin.im
Sat Jan 26 11:21:03 EST 2008


-----------------------------------------------------------------
Revision: 0f37c6a913d5207fa0fa327f5b11b215c7d35926
Ancestor: a37eca47349d0f765e8fc5f34fa821143fc86217
Author: nosnilmot at pidgin.im
Date: 2008-01-26T16:17:36
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtknotify.c pidgin/gtkprefs.c

ChangeLog: 

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.


-------------- next part --------------
============================================================
--- pidgin/gtknotify.c	0664850e570c67c2d2e7818b91f6cfdab24c89d6
+++ pidgin/gtknotify.c	55046385edbfead330c3650539c8c50ad6fa9ca7
@@ -1058,7 +1058,12 @@ pidgin_notify_uri(const char *uri)
 	/* 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 @@ pidgin_notify_uri(const char *uri)
 		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);
============================================================
--- pidgin/gtkprefs.c	bd4af7fbea7a9210f20a7c79e1e9ca6075d33eb4
+++ pidgin/gtkprefs.c	a0f8fc52d627a946b45974d566ff70285d6bc75c
@@ -1369,6 +1369,7 @@ static GList *get_available_browsers(voi
 		{N_("Netscape"), "netscape"},
 		{N_("Mozilla"), "mozilla"},
 		{N_("Konqueror"), "kfmclient"},
+		{N_("Desktop Default"), "xdg-open"},
 		{N_("GNOME Default"), "gnome-open"},
 		{N_("Galeon"), "galeon"},
 		{N_("Firefox"), "firefox"},
@@ -1391,6 +1392,14 @@ static GList *get_available_browsers(voi
 			browsers = g_list_prepend(browsers, (gpointer)_(possible_browsers[i].name));
 			if(browser_setting && !strcmp(possible_browsers[i].command, browser_setting))
 				browser_setting = NULL;
+			/* If xdg-open is valid, prefer it over gnome-open and skip forward */
+			if(!strcmp(possible_browsers[i].command, "xdg-open")) {
+				if (browser_setting && !strcmp("gnome-open", browser_setting)) {
+					purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/browser", possible_browsers[i].command);
+					browser_setting = NULL;
+				}
+				i++;
+			}
 		}
 	}
 


More information about the Commits mailing list