[evolution] GalA11yETableItem can have stored incorrect row count sometimes



commit 146e25f7f1f3165e909922575b73fcef39eec6cc
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jun 20 15:11:26 2016 +0200

    GalA11yETableItem can have stored incorrect row count sometimes
    
    This could cause a runtime warning
      eti_rows_deleted: assertion 'row + count <= old_nrows' failed
    which was due to old_nrows being zero, because no model-rows-inserted
    signal was received.

 e-util/gal-a11y-e-table-item.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/e-util/gal-a11y-e-table-item.c b/e-util/gal-a11y-e-table-item.c
index 6ddcb3e..11e82cd 100644
--- a/e-util/gal-a11y-e-table-item.c
+++ b/e-util/gal-a11y-e-table-item.c
@@ -848,6 +848,25 @@ eti_rows_deleted (ETableModel *model,
 }
 
 static void
+eti_model_changed (ETableModel *model,
+                  AtkObject *table_item)
+{
+       GalA11yETableItemPrivate *priv;
+       gint row_count;
+
+       g_return_if_fail (GAL_A11Y_IS_E_TABLE_ITEM (table_item));
+
+       priv = GET_PRIVATE (table_item);
+
+       row_count = e_table_model_row_count (model);
+
+       if (priv->rows != row_count) {
+               priv->rows = row_count;
+               g_signal_emit_by_name (table_item, "visible-data-changed");
+       }
+}
+
+static void
 eti_tree_model_node_changed_cb (ETreeModel *model,
                                 ETreePath node,
                                 ETableItem *eti)
@@ -1015,6 +1034,9 @@ eti_real_initialize (AtkObject *obj,
                model, "model-rows-deleted",
                G_CALLBACK (eti_rows_deleted), obj, 0);
        g_signal_connect_object (
+               model, "model-changed",
+               G_CALLBACK (eti_model_changed), obj, 0);
+       g_signal_connect_object (
                eti->header, "structure_change",
                G_CALLBACK (eti_header_structure_changed), obj, 0);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]