diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2010-03-05 00:56:36 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2010-03-05 00:56:36 +0800 |
commit | 6cbff108ac6211bfdc3638f23f3226f6521449fc (patch) | |
tree | 1c2f593f18f813cded3192a71cb96b4b107e1d64 /libempathy-gtk | |
parent | 82d23975943d3d1087c4c23ce88c78ae0dc468a0 (diff) | |
parent | b4d06351f186346bfc65204aa4057641bbde4649 (diff) | |
download | gsoc2013-empathy-6cbff108ac6211bfdc3638f23f3226f6521449fc.tar gsoc2013-empathy-6cbff108ac6211bfdc3638f23f3226f6521449fc.tar.gz gsoc2013-empathy-6cbff108ac6211bfdc3638f23f3226f6521449fc.tar.bz2 gsoc2013-empathy-6cbff108ac6211bfdc3638f23f3226f6521449fc.tar.lz gsoc2013-empathy-6cbff108ac6211bfdc3638f23f3226f6521449fc.tar.xz gsoc2013-empathy-6cbff108ac6211bfdc3638f23f3226f6521449fc.tar.zst gsoc2013-empathy-6cbff108ac6211bfdc3638f23f3226f6521449fc.zip |
Merge branch 'tweaks'
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-presence-chooser.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c index 7c4aae9ba..7e2e89fb6 100644 --- a/libempathy-gtk/empathy-presence-chooser.c +++ b/libempathy-gtk/empathy-presence-chooser.c @@ -345,7 +345,7 @@ presence_chooser_set_favorite_icon (EmpathyPresenceChooser *self) GTK_ENTRY_ICON_SECONDARY, _("Click to remove this status as a favorite")); } - else { + else if (priv->not_favorite_pixbuf != NULL) { /* custom entries can be favorited */ gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY, @@ -818,6 +818,9 @@ create_not_favorite_pixbuf (void) favorite = empathy_pixbuf_from_icon_name ("emblem-favorite", GTK_ICON_SIZE_MENU); + if (favorite == NULL) + return NULL; + result = gdk_pixbuf_copy (favorite); gdk_pixbuf_saturate_and_pixelate (favorite, result, 1.0, TRUE); @@ -832,7 +835,8 @@ icon_theme_changed_cb (GtkIconTheme *icon_theme, EmpathyPresenceChooserPriv *priv = GET_PRIV (self); /* Theme has changed, recreate the not-favorite icon */ - g_object_unref (priv->not_favorite_pixbuf); + if (priv->not_favorite_pixbuf != NULL) + g_object_unref (priv->not_favorite_pixbuf); priv->not_favorite_pixbuf = create_not_favorite_pixbuf (); /* Update the icon */ @@ -851,7 +855,6 @@ empathy_presence_chooser_init (EmpathyPresenceChooser *chooser) /* Create the not-favorite icon */ priv->not_favorite_pixbuf = create_not_favorite_pixbuf (); - g_assert (priv->not_favorite_pixbuf != NULL); empathy_signal_connect_weak (gtk_icon_theme_get_default (), "changed", G_CALLBACK (icon_theme_changed_cb), @@ -964,7 +967,8 @@ presence_chooser_finalize (GObject *object) g_object_unref (priv->idle); g_object_unref (priv->connectivity); - g_object_unref (priv->not_favorite_pixbuf); + if (priv->not_favorite_pixbuf != NULL) + g_object_unref (priv->not_favorite_pixbuf); G_OBJECT_CLASS (empathy_presence_chooser_parent_class)->finalize (object); } |