diff options
-rw-r--r-- | addressbook/ChangeLog | 7 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-table-adapter.c | 14 |
2 files changed, 16 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 970fb7be26..23319f1fef 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,12 @@ 2001-06-26 Christopher James Lahey <clahey@ximian.com> + * gui/widgets/e-addressbook-table-adapter.c (create_card): memmove + counts were off in this function. + (remove_card, modify_card): Moved the table notifications around a + bit here. + +2001-06-26 Christopher James Lahey <clahey@ximian.com> + * gui/component/select-names/e-select-names.c, gui/component/select-names/e-select-names.h, gui/component/select-names/select-names.glade diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index b54b2bcea8..0660bbd13a 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -265,12 +265,11 @@ create_card (EAddressbookModel *model, priv->count += count; priv->simples = g_renew(ECardSimple *, priv->simples, priv->count); - memmove (priv->simples + index + count - 1, priv->simples + index, count * sizeof (ECardSimple*)); + memmove (priv->simples + index + count, priv->simples + index, (priv->count - index - count) * sizeof (ECardSimple *)); e_table_model_pre_change (E_TABLE_MODEL (adapter)); for (i = 0; i < count; i ++) { priv->simples[index + i] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index + i)); - gtk_object_ref (GTK_OBJECT (priv->simples[index + i])); } e_table_model_rows_inserted (E_TABLE_MODEL (adapter), index, count); } @@ -281,9 +280,11 @@ remove_card (EAddressbookModel *model, EAddressbookTableAdapter *adapter) { EAddressbookTableAdapterPrivate *priv = adapter->priv; + + e_table_model_pre_change (E_TABLE_MODEL (adapter)); + gtk_object_unref (GTK_OBJECT (priv->simples[index])); - if (priv->count > 1) - memmove (priv->simples + index, priv->simples + index + 1, (priv->count - index - 1) * sizeof (ECardSimple*)); + memmove (priv->simples + index, priv->simples + index + 1, (priv->count - index - 1) * sizeof (ECardSimple *)); priv->count --; e_table_model_rows_deleted (E_TABLE_MODEL (adapter), index, 1); } @@ -294,10 +295,13 @@ modify_card (EAddressbookModel *model, EAddressbookTableAdapter *adapter) { EAddressbookTableAdapterPrivate *priv = adapter->priv; - e_table_model_row_changed (E_TABLE_MODEL (adapter), index); + + e_table_model_pre_change (E_TABLE_MODEL (adapter)); + gtk_object_unref (GTK_OBJECT (priv->simples[index])); priv->simples[index] = e_card_simple_new (e_addressbook_model_card_at (priv->model, index)); gtk_object_ref (GTK_OBJECT (priv->simples[index])); + e_table_model_row_changed (E_TABLE_MODEL (adapter), index); } static void |