summaryrefslogtreecommitdiff
path: root/gtk/gtkimage.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2015-12-30 15:45:07 +0100
committerTimm Bäder <mail@baedert.org>2016-01-02 15:46:45 +0100
commit3758762119827a62c93bd071dd6a7e63723d5e10 (patch)
tree3d621dbb2fc70b52e18e8f9f8aa3bd5a35fad504 /gtk/gtkimage.c
parent9704f46b3883fb9618e40dd8631e1174fa4f18bd (diff)
downloadgtk+-3758762119827a62c93bd071dd6a7e63723d5e10.tar.gz
GtkImage: Simplify _set_from_icon_name
We don't need to strdup icon_name since that will happen in _gtk_icon_helper_set_icon_name anyway.
Diffstat (limited to 'gtk/gtkimage.c')
-rw-r--r--gtk/gtkimage.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index f9bd7e15eb..4ac0931996 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1223,7 +1223,6 @@ gtk_image_set_from_icon_name (GtkImage *image,
GtkIconSize size)
{
GtkImagePrivate *priv;
- gchar *new_name;
g_return_if_fail (GTK_IS_IMAGE (image));
@@ -1231,18 +1230,14 @@ gtk_image_set_from_icon_name (GtkImage *image,
g_object_freeze_notify (G_OBJECT (image));
- new_name = g_strdup (icon_name);
gtk_image_clear (image);
- if (new_name)
- {
- _gtk_icon_helper_set_icon_name (priv->icon_helper, new_name, size);
- g_free (new_name);
- }
+ if (icon_name)
+ _gtk_icon_helper_set_icon_name (priv->icon_helper, icon_name, size);
g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_NAME]);
g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_ICON_SIZE]);
-
+
g_object_thaw_notify (G_OBJECT (image));
}