diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-06-27 11:17:29 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-06-27 11:17:29 +0800 |
commit | 8cb9e29ae525f39382cf7f06e8e988286fec0a47 (patch) | |
tree | e7782f182c11a5ec587d786693900e6a3921bf36 /addressbook | |
parent | 2ac2af6d4bcdfddf91c661a5c6ba96d6238a5a57 (diff) | |
download | gsoc2013-evolution-8cb9e29ae525f39382cf7f06e8e988286fec0a47.tar gsoc2013-evolution-8cb9e29ae525f39382cf7f06e8e988286fec0a47.tar.gz gsoc2013-evolution-8cb9e29ae525f39382cf7f06e8e988286fec0a47.tar.bz2 gsoc2013-evolution-8cb9e29ae525f39382cf7f06e8e988286fec0a47.tar.lz gsoc2013-evolution-8cb9e29ae525f39382cf7f06e8e988286fec0a47.tar.xz gsoc2013-evolution-8cb9e29ae525f39382cf7f06e8e988286fec0a47.tar.zst gsoc2013-evolution-8cb9e29ae525f39382cf7f06e8e988286fec0a47.zip |
memmove counts were off in this function. (remove_card, modify_card):
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.
svn path=/trunk/; revision=10525
Diffstat (limited to 'addressbook')
-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 |