diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-02-14 17:19:00 -0500 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-02-17 11:25:16 -0500 |
commit | b30c9ad791961a6cbf5622c1e3c34b8a088c0439 (patch) | |
tree | df27bb14092de9e359bf29f6d8b092792d488831 /src | |
parent | b75521b56f24bffa320ad7bb5bc61be6fa12cb96 (diff) | |
download | nautilus-b30c9ad791961a6cbf5622c1e3c34b8a088c0439.tar.gz |
floating-bar: add _cleanup_actions()
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-floating-bar.c | 26 | ||||
-rw-r--r-- | src/nautilus-floating-bar.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/nautilus-floating-bar.c b/src/nautilus-floating-bar.c index 29b58c029..48995fc12 100644 --- a/src/nautilus-floating-bar.c +++ b/src/nautilus-floating-bar.c @@ -318,3 +318,29 @@ nautilus_floating_bar_add_action (NautilusFloatingBar *self, g_signal_connect (button, "clicked", G_CALLBACK (action_button_clicked_cb), self); } + +void +nautilus_floating_bar_cleanup_actions (NautilusFloatingBar *self) +{ + GtkWidget *box, *widget; + GList *children, *l; + gpointer data; + + g_object_get (self, + "widget", &box, + NULL); + + children = gtk_container_get_children (GTK_CONTAINER (box)); + l = children; + + while (l != NULL) { + widget = l->data; + data = g_object_get_data (G_OBJECT (widget), "action-id"); + l = l->next; + + if (data != NULL) { + /* destroy this */ + gtk_widget_destroy (widget); + } + } +} diff --git a/src/nautilus-floating-bar.h b/src/nautilus-floating-bar.h index 837922341..a438e3ed2 100644 --- a/src/nautilus-floating-bar.h +++ b/src/nautilus-floating-bar.h @@ -69,6 +69,7 @@ void nautilus_floating_bar_set_show_spinner (NautilusFloatingBar *self, void nautilus_floating_bar_add_action (NautilusFloatingBar *self, const gchar *stock_id, gint action_id); +void nautilus_floating_bar_cleanup_actions (NautilusFloatingBar *self); #endif /* __NAUTILUS_FLOATING_BAR_H__ */ |