aboutsummaryrefslogtreecommitdiffstats
path: root/lib/egg/egg-editable-toolbar.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-10-23 21:45:15 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-10-23 21:45:15 +0800
commit5767e9aeb78133de615e08087cd96c4beb89f1d7 (patch)
treeebf9415942af1ef03df1f10c8f1c9153782cacdd /lib/egg/egg-editable-toolbar.c
parent2cb9d0fea6bf492977ab48f422a2840a675e3227 (diff)
downloadgsoc2013-epiphany-5767e9aeb78133de615e08087cd96c4beb89f1d7.tar
gsoc2013-epiphany-5767e9aeb78133de615e08087cd96c4beb89f1d7.tar.gz
gsoc2013-epiphany-5767e9aeb78133de615e08087cd96c4beb89f1d7.tar.bz2
gsoc2013-epiphany-5767e9aeb78133de615e08087cd96c4beb89f1d7.tar.lz
gsoc2013-epiphany-5767e9aeb78133de615e08087cd96c4beb89f1d7.tar.xz
gsoc2013-epiphany-5767e9aeb78133de615e08087cd96c4beb89f1d7.tar.zst
gsoc2013-epiphany-5767e9aeb78133de615e08087cd96c4beb89f1d7.zip
Remove invalid items
2003-10-23 Marco Pesenti Gritti <marco@gnome.org> * lib/egg/egg-editable-toolbar.c: (create_item_from_action), (egg_editable_toolbar_construct): Remove invalid items
Diffstat (limited to 'lib/egg/egg-editable-toolbar.c')
-rwxr-xr-xlib/egg/egg-editable-toolbar.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c
index bb42190e3..20877baa0 100755
--- a/lib/egg/egg-editable-toolbar.c
+++ b/lib/egg/egg-editable-toolbar.c
@@ -323,8 +323,16 @@ create_item_from_action (EggEditableToolbar *t,
{
g_signal_emit (G_OBJECT (t), egg_editable_toolbar_signals[ACTION_REQUEST],
0, action_name);
+
action = find_action (t, action_name);
- item = gtk_action_create_tool_item (action);
+ if (action)
+ {
+ item = gtk_action_create_tool_item (action);
+ }
+ else
+ {
+ return NULL;
+ }
}
gtk_widget_show (item);
@@ -748,8 +756,17 @@ egg_editable_toolbar_construct (EggEditableToolbar *t)
GtkWidget *item;
item = create_item (t, model, i, l);
- gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
- GTK_TOOL_ITEM (item), l);
+ if (item)
+ {
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
+ GTK_TOOL_ITEM (item), l);
+ }
+ else
+ {
+ egg_toolbars_model_remove_item (model, i, l);
+ l--;
+ n_items--;
+ }
}
if (n_items == 0)