# HG changeset patch # User Tim Ringenbach # Date 1087627654 0 # Node ID ade6b9c0dc8a9895aa3e5ba3c839bd93d49ad1aa # Parent b3bda982996b5a42e115bcdc4f97b5d4358f610f [gaim-migrate @ 10117] I'm a big fan of compiling for whatever version of Gtk I happen to be using. Btw, I think you're leaking a strv there buddy. committer: Tailor Script diff -r b3bda982996b -r ade6b9c0dc8a src/gtkaccount.c --- a/src/gtkaccount.c Sat Jun 19 04:57:43 2004 +0000 +++ b/src/gtkaccount.c Sat Jun 19 06:47:34 2004 +0000 @@ -389,27 +389,35 @@ gtk_image_set_from_file(GTK_IMAGE(dialog->buddy_icon_entry), ""); } +#if GTK_CHECK_VERSION(2,4,0) gboolean str_array_match(char **a, char **b) { int i, j; - for (i = 0; a[i] != NULL; i++) - for (j = 0; b[j] != NULL; j++) + for (i = 0; a[i] != NULL; i++) + for (j = 0; b[j] != NULL; j++) if (!g_ascii_strcasecmp(a[i], b[j])) return TRUE; return FALSE; } +#endif static void convert_and_set_buddy_icon(GaimAccount *account, const char *path) { +#if GTK_CHECK_VERSION(2,4,0) int width, height; - GaimPluginProtocolInfo *prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(account->protocol_id)); char **prpl_formats = g_strsplit (prpl_info->icon_spec.format,",",0); - GdkPixbufFormat *format = gdk_pixbuf_get_file_info (path, &width, &height); - char **pixbuf_formats = gdk_pixbuf_format_get_extensions(format); + char **pixbuf_formats; + GdkPixbufFormat *format; + GaimPluginProtocolInfo *prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(account->protocol_id)); + + format = gdk_pixbuf_get_file_info (path, &width, &height); + pixbuf_formats = gdk_pixbuf_format_get_extensions(format); if (str_array_match(pixbuf_formats, prpl_formats)) { +#endif gaim_account_set_buddy_icon(account, path); +#if GTK_CHECK_VERSION(2,4,0) } else { int i; GError *error = NULL; @@ -443,6 +451,7 @@ g_free(random); g_object_unref(pixbuf); } +#endif } static void