Commit d28bce02 authored by Cosimo Cecchi's avatar Cosimo Cecchi

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
parent fb94859e
......@@ -95,7 +95,7 @@ g_emblemed_icon_init (GEmblemedIcon *emblemed)
/**
* g_emblemed_icon_new:
* @icon: a #GIcon
* @emblem: a #GEmblem
* @emblem: (allow-none): a #GEmblem, or %NULL
*
* Creates a new emblemed icon for @icon with the emblem @emblem.
*
......@@ -111,12 +111,12 @@ g_emblemed_icon_new (GIcon *icon,
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 (emblem), NULL);
emblemed = G_EMBLEMED_ICON (g_object_new (G_TYPE_EMBLEMED_ICON, NULL));
emblemed->icon = g_object_ref (icon);
g_emblemed_icon_add_emblem (emblemed, emblem);
if (emblem != NULL)
g_emblemed_icon_add_emblem (emblemed, emblem);
return G_ICON (emblemed);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment