Mercurial > pidgin.yaz
comparison pidgin/gtkimhtmltoolbar.c @ 16375:391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
imgstore subsystem to not require IDs for everything.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 24 Apr 2007 03:57:07 +0000 |
parents | 0973688f4b74 |
children | 414b9c9405fd |
comparison
equal
deleted
inserted
replaced
16374:2a19bbc743ed | 16375:391a79778f89 |
---|---|
478 return; | 478 return; |
479 } | 479 } |
480 | 480 |
481 name = strrchr(filename, G_DIR_SEPARATOR) + 1; | 481 name = strrchr(filename, G_DIR_SEPARATOR) + 1; |
482 | 482 |
483 id = purple_imgstore_add(filedata, size, name); | 483 id = purple_imgstore_add_with_id(filedata, size, name); |
484 g_free(filedata); | 484 g_free(filedata); |
485 | 485 |
486 if (id == 0) { | 486 if (id == 0) { |
487 buf = g_strdup_printf(_("Failed to store image: %s\n"), filename); | 487 buf = g_strdup_printf(_("Failed to store image: %s\n"), filename); |
488 purple_notify_error(NULL, NULL, buf, NULL); | 488 purple_notify_error(NULL, NULL, buf, NULL); |
497 | 497 |
498 ins = gtk_text_buffer_get_insert(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->imhtml))); | 498 ins = gtk_text_buffer_get_insert(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->imhtml))); |
499 gtk_text_buffer_get_iter_at_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->imhtml)), | 499 gtk_text_buffer_get_iter_at_mark(gtk_text_view_get_buffer(GTK_TEXT_VIEW(toolbar->imhtml)), |
500 &iter, ins); | 500 &iter, ins); |
501 gtk_imhtml_insert_image_at_iter(GTK_IMHTML(toolbar->imhtml), id, &iter); | 501 gtk_imhtml_insert_image_at_iter(GTK_IMHTML(toolbar->imhtml), id, &iter); |
502 purple_imgstore_unref(id); | 502 purple_imgstore_unref_by_id(id); |
503 } | 503 } |
504 | 504 |
505 | 505 |
506 static void | 506 static void |
507 insert_image_cb(GtkWidget *save, GtkIMHtmlToolbar *toolbar) | 507 insert_image_cb(GtkWidget *save, GtkIMHtmlToolbar *toolbar) |