comparison 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
comparison
equal deleted inserted replaced
22207:b52f690502a4 22208:c77098cebf23
1056 place = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/browsers/place"); 1056 place = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/browsers/place");
1057 1057
1058 /* if they are running gnome, use the gnome web browser */ 1058 /* if they are running gnome, use the gnome web browser */
1059 if (purple_running_gnome() == TRUE) 1059 if (purple_running_gnome() == TRUE)
1060 { 1060 {
1061 command = g_strdup_printf("gnome-open %s", escaped); 1061 char *tmp = g_find_program_in_path("xdg-open");
1062 if (tmp == NULL)
1063 command = g_strdup_printf("gnome-open %s", escaped);
1064 else
1065 command = g_strdup_printf("xdg-open %s", escaped);
1066 g_free(tmp);
1062 } 1067 }
1063 else if (purple_running_osx() == TRUE) 1068 else if (purple_running_osx() == TRUE)
1064 { 1069 {
1065 command = g_strdup_printf("open %s", escaped); 1070 command = g_strdup_printf("open %s", escaped);
1066 } 1071 }
1071 command = g_strdup_printf("%s -w %s", web_browser, escaped); 1076 command = g_strdup_printf("%s -w %s", web_browser, escaped);
1072 else if (place == PIDGIN_BROWSER_NEW_TAB) 1077 else if (place == PIDGIN_BROWSER_NEW_TAB)
1073 command = g_strdup_printf("%s -n %s", web_browser, escaped); 1078 command = g_strdup_printf("%s -n %s", web_browser, escaped);
1074 else 1079 else
1075 command = g_strdup_printf("%s %s", web_browser, escaped); 1080 command = g_strdup_printf("%s %s", web_browser, escaped);
1081 }
1082 else if (!strcmp(web_browser, "xdg-open"))
1083 {
1084 command = g_strdup_printf("xdg-open %s", escaped);
1076 } 1085 }
1077 else if (!strcmp(web_browser, "gnome-open")) 1086 else if (!strcmp(web_browser, "gnome-open"))
1078 { 1087 {
1079 command = g_strdup_printf("gnome-open %s", escaped); 1088 command = g_strdup_printf("gnome-open %s", escaped);
1080 } 1089 }