aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-03 23:03:05 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-03 23:03:05 +0800
commitc228df2b30468e49051f64ca78476871946e403d (patch)
tree4f45009cdee3ca773268141afe2308bcfff22e2c /widgets
parentd6f46df60c83509f933c77f79e60796c1d48d7b7 (diff)
downloadgsoc2013-evolution-c228df2b30468e49051f64ca78476871946e403d.tar.gz
gsoc2013-evolution-c228df2b30468e49051f64ca78476871946e403d.tar.zst
gsoc2013-evolution-c228df2b30468e49051f64ca78476871946e403d.zip
Initialize the hash field. (model_changed_idle): Send cursor changed and
2001-10-03 Christopher James Lahey <clahey@ximian.com> * e-table-selection-model.c (e_table_selection_model_init): Initialize the hash field. (model_changed_idle): Send cursor changed and selection changed signals. (model_pre_change): If there's no cursor here, make sure to set the cursor_id to NULL. svn path=/trunk/; revision=13373
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-table-selection-model.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c
index 56fa07213a..716667a197 100644
--- a/widgets/table/e-table-selection-model.c
+++ b/widgets/table/e-table-selection-model.c
@@ -67,11 +67,11 @@ model_pre_change (ETableModel *etm, ETableSelectionModel *etsm)
gtk_object_get(GTK_OBJECT(etsm),
"cursor_row", &cursor_row,
NULL);
- if (etsm->cursor_id)
- g_free (etsm->cursor_id);
- if (cursor_row != -1) {
+ g_free (etsm->cursor_id);
+ if (cursor_row != -1)
etsm->cursor_id = e_table_model_get_save_id(etm, cursor_row);
- }
+ else
+ etsm->cursor_id = NULL;
}
}
@@ -84,6 +84,8 @@ model_changed_idle(ETableSelectionModel *etsm)
if (etsm->cursor_id && etm && e_table_model_has_save_id(etm)) {
int row_count = e_table_model_row_count(etm);
+ int cursor_row = -1;
+ int cursor_col = -1;
int i;
e_selection_model_array_confirm_row_count(E_SELECTION_MODEL_ARRAY(etsm));
for (i = 0; i < row_count; i++) {
@@ -92,13 +94,17 @@ model_changed_idle(ETableSelectionModel *etsm)
e_selection_model_change_one_row(E_SELECTION_MODEL(etsm), i, TRUE);
if (etsm->cursor_id && !strcmp(etsm->cursor_id, save_id)) {
- e_selection_model_change_cursor(E_SELECTION_MODEL(etsm), i, e_selection_model_cursor_col(E_SELECTION_MODEL(etsm)));
+ cursor_row = i;
+ cursor_col = e_selection_model_cursor_col(E_SELECTION_MODEL(etsm));
+ e_selection_model_change_cursor(E_SELECTION_MODEL(etsm), cursor_row, cursor_col);
g_free(etsm->cursor_id);
etsm->cursor_id = NULL;
}
g_free(save_id);
}
free_hash(etsm);
+ e_selection_model_cursor_changed (E_SELECTION_MODEL(etsm), cursor_row, cursor_col);
+ e_selection_model_selection_changed (E_SELECTION_MODEL(etsm));
}
etsm->model_changed_idle_id = 0;
return FALSE;
@@ -245,7 +251,7 @@ static void
e_table_selection_model_init (ETableSelectionModel *selection)
{
selection->model = NULL;
- /* selection->hash = NULL;*/
+ selection->hash = NULL;
selection->cursor_id = NULL;
selection->model_changed_idle_id = 0;