| 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 |
| 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 } |