mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
emblemed-icon: allow passing a NULL emblem to g_emblemed_icon_new()
So that if we already have a list of emblems we know we want to add to the icon, we can use e.g. a for loop to add them all, without picking the first and looping from the second. https://bugzilla.gnome.org/show_bug.cgi?id=634504
This commit is contained in:
parent
fb94859e84
commit
d28bce02dc
@ -95,7 +95,7 @@ g_emblemed_icon_init (GEmblemedIcon *emblemed)
|
|||||||
/**
|
/**
|
||||||
* g_emblemed_icon_new:
|
* g_emblemed_icon_new:
|
||||||
* @icon: a #GIcon
|
* @icon: a #GIcon
|
||||||
* @emblem: a #GEmblem
|
* @emblem: (allow-none): a #GEmblem, or %NULL
|
||||||
*
|
*
|
||||||
* Creates a new emblemed icon for @icon with the emblem @emblem.
|
* Creates a new emblemed icon for @icon with the emblem @emblem.
|
||||||
*
|
*
|
||||||
@ -111,11 +111,11 @@ g_emblemed_icon_new (GIcon *icon,
|
|||||||
|
|
||||||
g_return_val_if_fail (G_IS_ICON (icon), NULL);
|
g_return_val_if_fail (G_IS_ICON (icon), NULL);
|
||||||
g_return_val_if_fail (!G_IS_EMBLEM (icon), NULL);
|
g_return_val_if_fail (!G_IS_EMBLEM (icon), NULL);
|
||||||
g_return_val_if_fail (G_IS_EMBLEM (emblem), NULL);
|
|
||||||
|
|
||||||
emblemed = G_EMBLEMED_ICON (g_object_new (G_TYPE_EMBLEMED_ICON, NULL));
|
emblemed = G_EMBLEMED_ICON (g_object_new (G_TYPE_EMBLEMED_ICON, NULL));
|
||||||
emblemed->icon = g_object_ref (icon);
|
emblemed->icon = g_object_ref (icon);
|
||||||
|
|
||||||
|
if (emblem != NULL)
|
||||||
g_emblemed_icon_add_emblem (emblemed, emblem);
|
g_emblemed_icon_add_emblem (emblemed, emblem);
|
||||||
|
|
||||||
return G_ICON (emblemed);
|
return G_ICON (emblemed);
|
||||||
|
Loading…
Reference in New Issue
Block a user