summaryrefslogtreecommitdiffstats
path: root/src/sbitem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sbitem.c')
-rw-r--r--src/sbitem.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sbitem.c b/src/sbitem.c
index a53949e..b49a98f 100644
--- a/src/sbitem.c
+++ b/src/sbitem.c
@@ -63,11 +63,24 @@ SBItem *sbitem_new(plist_t icon_info)
item = g_new0(SBItem, 1);
item->node = plist_copy(icon_info);
item->texture = NULL;
+ item->drawn = FALSE;
item->is_dock_item = FALSE;
+ item->is_folder = FALSE;
+ item->subitems = NULL;
return item;
}
+SBItem *sbitem_new_with_subitems(plist_t icon_info, GList *subitems)
+{
+ SBItem *item = sbitem_new(icon_info);
+ if (item) {
+ item->subitems = subitems;
+ item->is_folder = TRUE;
+ }
+ return item;
+}
+
void sbitem_free(SBItem *item)
{
if (item) {
@@ -85,6 +98,10 @@ void sbitem_free(SBItem *item)
item->texture = NULL;
}
}
+ if (item->subitems) {
+ g_list_foreach(item->subitems, (GFunc)(g_func_sbitem_free), NULL);
+ g_list_free(item->subitems);
+ }
if (item->label && CLUTTER_IS_ACTOR(item->label)) {
clutter_actor_destroy(item->label);
item->label = NULL;