emblemedicon: add g_emblemed_icon_clear_emblems()

https://bugzilla.gnome.org/show_bug.cgi?id=637171
This commit is contained in:
Cosimo Cecchi 2010-12-09 18:16:17 +01:00
parent 056a5d753d
commit f53d518a3d
2 changed files with 13 additions and 0 deletions

View File

@ -160,6 +160,18 @@ g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed)
return emblemed->emblems; return emblemed->emblems;
} }
void
g_emblemed_icon_clear_emblems (GEmblemedIcon *emblemed)
{
g_return_if_fail (G_IS_EMBLEMED_ICON (emblemed));
if (emblemed->emblems == NULL)
return;
g_list_free_full (emblemed->emblems, g_object_unref);
emblemed->emblems = NULL;
}
static gint static gint
g_emblem_comp (GEmblem *a, g_emblem_comp (GEmblem *a,
GEmblem *b) GEmblem *b)

View File

@ -56,6 +56,7 @@ GIcon *g_emblemed_icon_get_icon (GEmblemedIcon *emblemed);
GList *g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed); GList *g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed);
void g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed, void g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed,
GEmblem *emblem); GEmblem *emblem);
void g_emblemed_icon_clear_emblems (GEmblemedIcon *emblemed);
G_END_DECLS G_END_DECLS