st/icon: Simplify property setting in set_gicon()
We can easily use `g_set_object()` to set the gicon property here. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888
This commit is contained in:
parent
3b46c3910c
commit
c0fcf2d3a8
@ -572,15 +572,7 @@ st_icon_set_gicon (StIcon *icon, GIcon *gicon)
|
|||||||
if (g_icon_equal (icon->priv->gicon, gicon)) /* do nothing */
|
if (g_icon_equal (icon->priv->gicon, gicon)) /* do nothing */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (icon->priv->gicon)
|
g_set_object (&icon->priv->gicon, gicon);
|
||||||
{
|
|
||||||
g_object_unref (icon->priv->gicon);
|
|
||||||
icon->priv->gicon = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gicon)
|
|
||||||
icon->priv->gicon = g_object_ref (gicon);
|
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (icon), props[PROP_GICON]);
|
g_object_notify_by_pspec (G_OBJECT (icon), props[PROP_GICON]);
|
||||||
|
|
||||||
st_icon_update (icon);
|
st_icon_update (icon);
|
||||||
|
Loading…
Reference in New Issue
Block a user