From 132d798d18efdf386d7e74c505b16941406cbd01 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 8 Mar 2004 23:43:31 +0000 Subject: Check if the dragged item is a separator. Fixes crash when it _is_ a 2004-03-09 Christian Persch * lib/egg/egg-toolbar-editor.c: (editor_drag_data_received_cb): Check if the dragged item is a separator. Fixes crash when it _is_ a separator. * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_remove_toolbar): Fix logic check for removable toolbar, & instead of &&. * src/ephy-location-action.c: (create_menu_proxy_cb), (connect_proxy), (ephy_location_action_activate): Don't make a proxy menu item for the location entry. Fixes crash when trying to activate its proxy menu item. --- lib/egg/egg-toolbar-editor.c | 9 ++++++++- lib/egg/egg-toolbars-model.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/egg') diff --git a/lib/egg/egg-toolbar-editor.c b/lib/egg/egg-toolbar-editor.c index e77c801f0..991f4843b 100755 --- a/lib/egg/egg-toolbar-editor.c +++ b/lib/egg/egg-toolbar-editor.c @@ -306,11 +306,18 @@ editor_drag_data_received_cb (GtkWidget *widget, EggToolbarEditor *editor) { GtkAction *action; + const char *data; g_return_if_fail (EGG_IS_TOOLBAR_EDITOR (editor)); g_return_if_fail (selection_data != NULL); - action = find_action (editor, (const char *)selection_data->data); + if (selection_data->length <= 0 || selection_data->data == NULL) return; + + data = (const char *) selection_data->data; + + if (strcmp (data, "separator") == 0) return; + + action = find_action (editor, data); g_return_if_fail (action != NULL); if (g_list_find (editor->priv->default_actions_list, action)) diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index 8e44d9365..0da5cbd69 100755 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -585,7 +585,7 @@ egg_toolbars_model_remove_toolbar (EggToolbarsModel *t, flags = egg_toolbars_model_get_flags (t, position); - if (!(flags && EGG_TB_MODEL_NOT_REMOVABLE)) + if (!(flags & EGG_TB_MODEL_NOT_REMOVABLE)) { node = g_node_nth_child (t->priv->toolbars, position); g_return_if_fail (node != NULL); -- cgit v1.2.3