comparison src/gtkutils.c @ 6846:8ab95f4c9800

[gaim-migrate @ 7391] Added new buddy icon caching code. Each GaimBuddy has its own icon, and the complete list of all icons is now stored in a set of hashtables for quick retrieval. Buddy icons now live much happier in the core, with the magma and tooth fairies (that's where they really live). committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 15 Sep 2003 07:35:49 +0000
parents 3c10d6de8bf3
children 9946001989a3
comparison
equal deleted inserted replaced
6845:5de4d9a4e0e2 6846:8ab95f4c9800
264 do_save_icon(GtkObject *obj, GaimConversation *c) 264 do_save_icon(GtkObject *obj, GaimConversation *c)
265 { 265 {
266 GaimGtkConversation *gtkconv; 266 GaimGtkConversation *gtkconv;
267 FILE *file; 267 FILE *file;
268 const char *f; 268 const char *f;
269 269
270 gtkconv = GAIM_GTK_CONVERSATION(c); 270 gtkconv = GAIM_GTK_CONVERSATION(c);
271 271
272 f = gtk_file_selection_get_filename( 272 f = gtk_file_selection_get_filename(
273 GTK_FILE_SELECTION(gtkconv->u.im->save_icon)); 273 GTK_FILE_SELECTION(gtkconv->u.im->save_icon));
274 274
275 if (gaim_gtk_check_if_dir(f, GTK_FILE_SELECTION(gtkconv->u.im->save_icon))) 275 if (gaim_gtk_check_if_dir(f, GTK_FILE_SELECTION(gtkconv->u.im->save_icon)))
276 return; 276 return;
277 277
278 if ((file = fopen(f, "w")) != NULL) { 278 if ((file = fopen(f, "w")) != NULL) {
279 int len; 279 GaimBuddyIcon *icon = gaim_im_get_icon(GAIM_IM(c));
280 void *data = get_icon_data(gaim_conversation_get_gc(c), 280 size_t len;
281 normalize(gaim_conversation_get_name(c)), 281 const void *data = gaim_buddy_icon_get_data(icon, &len);
282 &len);
283 282
284 if (data) 283 if (data)
285 fwrite(data, 1, len, file); 284 fwrite(data, 1, len, file);
286 285
287 fclose(file); 286 fclose(file);