Mercurial > pidgin.yaz
comparison src/util.c @ 12483:54448bd2ccc7
[gaim-migrate @ 14795]
Allow the file transfer window open button to work in environments other than win32 and GNOME. In KDE, we do The Right Thing. Otherwise, we fall back the browser.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Wed, 14 Dec 2005 19:06:27 +0000 |
parents | a60677ffcf8b |
children | 13599d978a31 |
comparison
equal
deleted
inserted
replaced
12482:bd5b3f82dd8e | 12483:54448bd2ccc7 |
---|---|
2229 | 2229 |
2230 gboolean | 2230 gboolean |
2231 gaim_running_gnome(void) | 2231 gaim_running_gnome(void) |
2232 { | 2232 { |
2233 gchar *tmp = g_find_program_in_path("gnome-open"); | 2233 gchar *tmp = g_find_program_in_path("gnome-open"); |
2234 if ((g_getenv("GNOME_DESKTOP_SESSION_ID") != NULL) && | 2234 |
2235 (tmp != NULL)) | 2235 if (tmp == NULL) |
2236 { | 2236 return FALSE; |
2237 g_free(tmp); | 2237 g_free(tmp); |
2238 | |
2239 return (g_getenv("GNOME_DESKTOP_SESSION_ID") != NULL); | |
2240 } | |
2241 | |
2242 gboolean | |
2243 gaim_running_kde(void) | |
2244 { | |
2245 gchar *tmp = g_find_program_in_path("kfmclient"); | |
2246 const char *session; | |
2247 | |
2248 if (tmp == NULL) | |
2249 return FALSE; | |
2250 g_free(tmp); | |
2251 | |
2252 session = g_getenv("KDE_FULL_SESSION"); | |
2253 if (session != NULL && !strcmp(session, "true")) | |
2238 return TRUE; | 2254 return TRUE; |
2239 } | 2255 |
2240 g_free(tmp); | 2256 /* If you run Gaim from Konsole under !KDE, this will provide a |
2241 return FALSE; | 2257 * a false positive. Since we do the GNOME checks first, this is |
2258 * only a problem if you're running something !(KDE || GNOME) and | |
2259 * you run Gaim from Konsole. This really shouldn't be a problem. */ | |
2260 return ((g_getenv("KDEDIR") != NULL) || g_getenv("KDEDIRS") != NULL); | |
2242 } | 2261 } |
2243 | 2262 |
2244 char * | 2263 char * |
2245 gaim_fd_get_ip(int fd) | 2264 gaim_fd_get_ip(int fd) |
2246 { | 2265 { |