Mercurial > pidgin
comparison src/gtkutils.c @ 8381:95afeb9a0c96
[gaim-migrate @ 9109]
Thanks wing
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 02 Mar 2004 04:59:33 +0000 |
parents | 19459d9eead2 |
children | 9773e3f3ec7a |
comparison
equal
deleted
inserted
replaced
8380:4a5b36510665 | 8381:95afeb9a0c96 |
---|---|
271 do_save_icon(GtkObject *obj, GaimConversation *c) | 271 do_save_icon(GtkObject *obj, GaimConversation *c) |
272 { | 272 { |
273 GaimGtkConversation *gtkconv; | 273 GaimGtkConversation *gtkconv; |
274 FILE *file; | 274 FILE *file; |
275 const char *f; | 275 const char *f; |
276 GaimBuddyIcon *icon; | |
277 size_t len; | |
278 const void *data; | |
279 | |
276 | 280 |
277 gtkconv = GAIM_GTK_CONVERSATION(c); | 281 gtkconv = GAIM_GTK_CONVERSATION(c); |
278 | 282 |
279 f = gtk_file_selection_get_filename( | 283 f = gtk_file_selection_get_filename( |
280 GTK_FILE_SELECTION(gtkconv->u.im->save_icon)); | 284 GTK_FILE_SELECTION(gtkconv->u.im->save_icon)); |
281 | 285 |
282 if (gaim_gtk_check_if_dir(f, GTK_FILE_SELECTION(gtkconv->u.im->save_icon))) | 286 if (gaim_gtk_check_if_dir(f, GTK_FILE_SELECTION(gtkconv->u.im->save_icon))) |
283 return; | 287 return; |
284 | 288 |
285 GaimBuddyIcon *icon = gaim_conv_im_get_icon(GAIM_CONV_IM(c)); | 289 icon = gaim_conv_im_get_icon(GAIM_CONV_IM(c)); |
286 size_t len; | 290 data = gaim_buddy_icon_get_data(icon, &len); |
287 const void *data = gaim_buddy_icon_get_data(icon, &len); | |
288 | 291 |
289 if ((len > 0) && (data != NULL) && (file = fopen(f, "wb")) != NULL) { | 292 if ((len > 0) && (data != NULL) && (file = fopen(f, "wb")) != NULL) { |
290 fwrite(data, 1, len, file); | 293 fwrite(data, 1, len, file); |
291 fclose(file); | 294 fclose(file); |
292 } else { | 295 } else { |