aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-selection-model.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-06-20 18:29:14 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-06-20 18:29:14 +0800
commit510b2562813a16cf7795fcf0351e0f1aba9246d4 (patch)
tree978bc5a113fa4a8fe00a661f84d37e6ebcbaf44c /widgets/table/e-tree-selection-model.c
parent56b1fe3fe1f07f85cedeb0efa9d622174dc25056 (diff)
downloadgsoc2013-evolution-510b2562813a16cf7795fcf0351e0f1aba9246d4.tar.gz
gsoc2013-evolution-510b2562813a16cf7795fcf0351e0f1aba9246d4.tar.zst
gsoc2013-evolution-510b2562813a16cf7795fcf0351e0f1aba9246d4.zip
If only a few rows have changed, emit each as a separate row_changed event
2005-06-08 Not Zed <NotZed@Ximian.com> * e-tree-selection-model.c (etsm_toggle_single_row) (etsm_select_single_row): If only a few rows have changed, emit each as a separate row_changed event rather than triggering a complete redraw of the whole window. svn path=/trunk/; revision=29551
Diffstat (limited to 'widgets/table/e-tree-selection-model.c')
-rw-r--r--widgets/table/e-tree-selection-model.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c
index 5ecabb796a..1a9cac548a 100644
--- a/widgets/table/e-tree-selection-model.c
+++ b/widgets/table/e-tree-selection-model.c
@@ -573,16 +573,44 @@ etsm_cursor_col (ESelectionModel *selection)
}
static void
+etsm_get_rows(int row, void *d)
+{
+ int **rowp = d;
+
+ **rowp = row;
+ (*rowp)++;
+}
+
+static void
etsm_select_single_row (ESelectionModel *selection, gint row)
{
ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection);
ETreePath path = e_tree_table_adapter_node_at_row (etsm->priv->etta, row);
+ int rows[5], *rowp = NULL, size;
g_return_if_fail (path != NULL);
+ /* we really only care about the size=1 case (cursor changed),
+ but this doesn't cost much */
+ size = g_hash_table_size(etsm->priv->paths);
+ if (size > 0 && size <= 5) {
+ rowp = rows;
+ etsm_foreach(selection, etsm_get_rows, &rowp);
+ }
+
select_single_path (etsm, path);
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
+ if (size>5) {
+ e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
+ } else {
+ if (rowp) {
+ int *p = rows;
+
+ while (p<rowp)
+ e_selection_model_selection_row_changed((ESelectionModel *)etsm, *p++);
+ }
+ e_selection_model_selection_row_changed((ESelectionModel *)etsm, row);
+ }
}
static void
@@ -599,7 +627,8 @@ etsm_toggle_single_row (ESelectionModel *selection, gint row)
g_hash_table_insert (etsm->priv->paths, path, path);
etsm->priv->start_path = NULL;
- e_selection_model_selection_changed(E_SELECTION_MODEL(etsm));
+
+ e_selection_model_selection_row_changed((ESelectionModel *)etsm, row);
}
static void