diff options
author | Milan Crha <mcrha@redhat.com> | 2013-11-15 16:06:57 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-11-15 16:06:57 +0800 |
commit | 570c6374806d0f1ec59cf7a72543efe6b5b637be (patch) | |
tree | c5390b1fcb73f30c28bf37168add9bf1dc622b42 /e-util/gal-a11y-e-table-item.c | |
parent | 1be51f232560f864ba8795a38e55d472b5b0e2b3 (diff) | |
download | gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.gz gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.bz2 gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.lz gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.xz gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.zst gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.zip |
Fix/mute issues found by Coverity scan
This makes the code free of Coverity scan issues.
It is sometimes quite pedantic and expects/suggests some
coding habits, thus certain changes may look weird, but for a good
thing, I hope. The code is also tagged with Coverity scan
suppressions, to keep the code as is and hide the warning too.
Also note that Coverity treats g_return_if_fail(), g_assert() and
similar macros as unreliable, and it's true these can be disabled
during the compile time, thus it brings in other set of 'weird'
changes.
Diffstat (limited to 'e-util/gal-a11y-e-table-item.c')
-rw-r--r-- | e-util/gal-a11y-e-table-item.c | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/e-util/gal-a11y-e-table-item.c b/e-util/gal-a11y-e-table-item.c index 51bce1725b..c3bbded403 100644 --- a/e-util/gal-a11y-e-table-item.c +++ b/e-util/gal-a11y-e-table-item.c @@ -1141,41 +1141,38 @@ gal_a11y_e_table_item_new (ETableItem *item) if (GET_PRIVATE (a11y)->columns == NULL) return NULL; - if (item) { - g_signal_connect ( - item, "selection_model_removed", - G_CALLBACK (eti_a11y_selection_model_removed_cb), NULL); + g_signal_connect ( + item, "selection_model_removed", + G_CALLBACK (eti_a11y_selection_model_removed_cb), NULL); + g_signal_connect ( + item, "selection_model_added", + G_CALLBACK (eti_a11y_selection_model_added_cb), NULL); + if (item->selection) + gal_a11y_e_table_item_ref_selection ( + a11y, + item->selection); + + /* find the TableItem's parent: table or tree */ + GET_PRIVATE (a11y)->widget = gtk_widget_get_parent ( + GTK_WIDGET (item->parent.canvas)); + parent = gtk_widget_get_accessible (GET_PRIVATE (a11y)->widget); + name = atk_object_get_name (parent); + if (name) + atk_object_set_name (accessible, name); + atk_object_set_parent (accessible, parent); + + if (E_IS_TREE (GET_PRIVATE (a11y)->widget)) { + ETreeModel *model; + model = e_tree_get_model (E_TREE (GET_PRIVATE (a11y)->widget)); g_signal_connect ( - item, "selection_model_added", - G_CALLBACK (eti_a11y_selection_model_added_cb), NULL); - if (item->selection) - gal_a11y_e_table_item_ref_selection ( - a11y, - item->selection); - - /* find the TableItem's parent: table or tree */ - GET_PRIVATE (a11y)->widget = gtk_widget_get_parent ( - GTK_WIDGET (item->parent.canvas)); - parent = gtk_widget_get_accessible (GET_PRIVATE (a11y)->widget); - name = atk_object_get_name (parent); - if (name) - atk_object_set_name (accessible, name); - atk_object_set_parent (accessible, parent); - - if (E_IS_TREE (GET_PRIVATE (a11y)->widget)) { - ETreeModel *model; - model = e_tree_get_model (E_TREE (GET_PRIVATE (a11y)->widget)); - g_signal_connect ( - model, "node_changed", - G_CALLBACK (eti_tree_model_node_changed_cb), item); - accessible->role = ATK_ROLE_TREE_TABLE; - } else if (E_IS_TABLE (GET_PRIVATE (a11y)->widget)) { - accessible->role = ATK_ROLE_TABLE; - } + model, "node_changed", + G_CALLBACK (eti_tree_model_node_changed_cb), item); + accessible->role = ATK_ROLE_TREE_TABLE; + } else if (E_IS_TABLE (GET_PRIVATE (a11y)->widget)) { + accessible->role = ATK_ROLE_TABLE; } - if (item) - g_object_weak_ref (G_OBJECT (item), item_finalized, g_object_ref (a11y)); + g_object_weak_ref (G_OBJECT (item), item_finalized, g_object_ref (a11y)); esm = item->selection; |