[glib] emblemedicon: add g_emblemed_icon_clear_emblems()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] emblemedicon: add g_emblemed_icon_clear_emblems()
- Date: Wed, 15 Dec 2010 10:46:25 +0000 (UTC)
commit f53d518a3de99eb8418a35b8f1e163026130687b
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Dec 9 18:16:17 2010 +0100
emblemedicon: add g_emblemed_icon_clear_emblems()
https://bugzilla.gnome.org/show_bug.cgi?id=637171
gio/gemblemedicon.c | 12 ++++++++++++
gio/gemblemedicon.h | 1 +
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gio/gemblemedicon.c b/gio/gemblemedicon.c
index 0364cba..331f35d 100644
--- a/gio/gemblemedicon.c
+++ b/gio/gemblemedicon.c
@@ -160,6 +160,18 @@ g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed)
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
g_emblem_comp (GEmblem *a,
GEmblem *b)
diff --git a/gio/gemblemedicon.h b/gio/gemblemedicon.h
index 7a5dc4d..7eb99f0 100644
--- a/gio/gemblemedicon.h
+++ b/gio/gemblemedicon.h
@@ -56,6 +56,7 @@ GIcon *g_emblemed_icon_get_icon (GEmblemedIcon *emblemed);
GList *g_emblemed_icon_get_emblems (GEmblemedIcon *emblemed);
void g_emblemed_icon_add_emblem (GEmblemedIcon *emblemed,
GEmblem *emblem);
+void g_emblemed_icon_clear_emblems (GEmblemedIcon *emblemed);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]