[gtk+] image: Split out a function
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] image: Split out a function
- Date: Wed, 2 Dec 2015 14:53:06 +0000 (UTC)
commit c66a2057afb73c3743d60987a1618b0a7cdb710e
Author: Benjamin Otte <otte redhat com>
Date: Wed Dec 2 14:54:15 2015 +0100
image: Split out a function
gtk/gtkimage.c | 34 +++++++++++++++++++++-------------
1 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 2570b1d..58a46c0 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1742,19 +1742,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS
}
static void
-gtk_image_reset (GtkImage *image)
+gtk_image_notify_for_storage_type (GtkImage *image,
+ GtkImageType storage_type)
{
- GtkImagePrivate *priv = image->priv;
- GtkImageType storage_type;
-
- g_object_freeze_notify (G_OBJECT (image));
- storage_type = gtk_image_get_storage_type (image);
-
- if (storage_type != GTK_IMAGE_EMPTY)
- g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_STORAGE_TYPE]);
-
- g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_SIZE]);
-
switch (storage_type)
{
case GTK_IMAGE_PIXBUF:
@@ -1767,7 +1757,6 @@ gtk_image_reset (GtkImage *image)
g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_SET]);
break;
case GTK_IMAGE_ANIMATION:
- gtk_image_reset_anim_iter (image);
g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_PIXBUF_ANIMATION]);
break;
case GTK_IMAGE_ICON_NAME:
@@ -1780,6 +1769,25 @@ gtk_image_reset (GtkImage *image)
default:
break;
}
+}
+
+static void
+gtk_image_reset (GtkImage *image)
+{
+ GtkImagePrivate *priv = image->priv;
+ GtkImageType storage_type;
+
+ g_object_freeze_notify (G_OBJECT (image));
+ storage_type = gtk_image_get_storage_type (image);
+
+ if (storage_type != GTK_IMAGE_EMPTY)
+ g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_STORAGE_TYPE]);
+
+ g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_SIZE]);
+
+ gtk_image_reset_anim_iter (image);
+
+ gtk_image_notify_for_storage_type (image, storage_type);
if (priv->filename)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]