empathy r1668 - trunk/libempathy-gtk
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r1668 - trunk/libempathy-gtk
- Date: Tue, 11 Nov 2008 15:25:36 +0000 (UTC)
Author: xclaesse
Date: Tue Nov 11 15:25:36 2008
New Revision: 1668
URL: http://svn.gnome.org/viewvc/empathy?rev=1668&view=rev
Log:
Consolidate hardcoding avatars to PNG to one function.
(Incidentally, return "image/png" rather than "png" for the mime type,
as the latter is not a mime type.)
Modified:
trunk/libempathy-gtk/empathy-avatar-chooser.c
Modified: trunk/libempathy-gtk/empathy-avatar-chooser.c
==============================================================================
--- trunk/libempathy-gtk/empathy-avatar-chooser.c (original)
+++ trunk/libempathy-gtk/empathy-avatar-chooser.c Tue Nov 11 15:25:36 2008
@@ -45,6 +45,7 @@
typedef struct {
gchar *image_data;
gsize image_data_size;
+ gchar *mime_type;
} EmpathyAvatarChooserPriv;
static void avatar_chooser_finalize (GObject *object);
@@ -159,6 +160,7 @@
priv = GET_PRIV (object);
g_free (priv->image_data);
+ g_free (priv->mime_type);
G_OBJECT_CLASS (empathy_avatar_chooser_parent_class)->finalize (object);
}
@@ -176,6 +178,8 @@
g_free (priv->image_data);
priv->image_data = NULL;
priv->image_data_size = 0;
+ g_free (priv->mime_type);
+ priv->mime_type = NULL;
if (pixbuf) {
pixbuf_view = empathy_pixbuf_scale_down_if_necessary (pixbuf, AVATAR_SIZE_VIEW);
@@ -189,6 +193,8 @@
DEBUG ("Failed to save pixbuf: %s",
error ? error->message : "No error given");
g_clear_error (&error);
+ } else {
+ priv->mime_type = "image/png";
}
image = gtk_image_new_from_pixbuf (pixbuf_view);
@@ -571,7 +577,7 @@
*data_size = priv->image_data_size;
}
if (mime_type) {
- *mime_type = "png";
+ *mime_type = priv->mime_type;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]