pidgin/gtksmiley.c

branch
cpw.qulogic.gtk3
changeset 32433
f539a2c083b2
parent 32424
be4a642b2d45
parent 31889
96183796df0c
child 32438
dc8991868906
child 33120
f6f1a27ade72
equal deleted inserted replaced
32432:47b61b9e08e6 32433:f539a2c083b2
330 if (!filename) 330 if (!filename)
331 return; 331 return;
332 332
333 g_free(s->filename); 333 g_free(s->filename);
334 s->filename = g_strdup(filename); 334 s->filename = g_strdup(filename);
335 pixbuf = gdk_pixbuf_new_from_file_at_scale(filename, 64, 64, FALSE, NULL); 335 pixbuf = pidgin_pixbuf_new_from_file_at_scale(filename, 64, 64, FALSE);
336 gtk_image_set_from_pixbuf(GTK_IMAGE(s->smiley_image), pixbuf); 336 gtk_image_set_from_pixbuf(GTK_IMAGE(s->smiley_image), pixbuf);
337 if (pixbuf) 337 if (pixbuf)
338 g_object_unref(G_OBJECT(pixbuf)); 338 g_object_unref(G_OBJECT(pixbuf));
339 gtk_widget_grab_focus(s->smile); 339 gtk_widget_grab_focus(s->smile);
340 340
689 { 689 {
690 SmileyManager *dialog = user_data; 690 SmileyManager *dialog = user_data;
691 FILE *f; 691 FILE *f;
692 gchar *path; 692 gchar *path;
693 size_t wc; 693 size_t wc;
694 GError *err = NULL;
695 PidginSmiley *ps; 694 PidginSmiley *ps;
696 GdkPixbuf *image; 695 GdkPixbuf *image;
697 696
698 if ((error_message != NULL) || (len == 0)) { 697 if ((error_message != NULL) || (len == 0)) {
699 return; 698 return;
708 g_free(path); 707 g_free(path);
709 return; 708 return;
710 } 709 }
711 fclose(f); 710 fclose(f);
712 711
713 image = gdk_pixbuf_new_from_file(path, &err); 712 image = pidgin_pixbuf_new_from_file(path);
714 g_unlink(path); 713 g_unlink(path);
715 g_free(path); 714 g_free(path);
716 if (err) { 715 if (!image)
717 g_error_free(err); 716 return;
718 return;
719 }
720 717
721 ps = pidgin_smiley_edit(dialog->window, NULL); 718 ps = pidgin_smiley_edit(dialog->window, NULL);
722 pidgin_smiley_editor_set_image(ps, image); 719 pidgin_smiley_editor_set_image(ps, image);
723 pidgin_smiley_editor_set_data(ps, g_memdup(smileydata, len), len); 720 pidgin_smiley_editor_set_data(ps, g_memdup(smileydata, len), len);
724 } 721 }

mercurial