diff options
author | Sivaiah Nallagatla <snallagatla@novell.com> | 2005-01-22 12:03:51 +0800 |
---|---|---|
committer | Sivaiah Nallagatla <siva@src.gnome.org> | 2005-01-22 12:03:51 +0800 |
commit | 59dd1b2a261be4b5ba8784ce3619f7e002c98f2f (patch) | |
tree | 9081439bd485ad7e3c294c9fdcf51e066db74a46 /addressbook/gui/widgets/e-addressbook-model.c | |
parent | 2420ae32bd6f7e9672ef84ca3f826dfa8d11a7f4 (diff) | |
download | gsoc2013-evolution-59dd1b2a261be4b5ba8784ce3619f7e002c98f2f.tar.gz gsoc2013-evolution-59dd1b2a261be4b5ba8784ce3619f7e002c98f2f.tar.zst gsoc2013-evolution-59dd1b2a261be4b5ba8784ce3619f7e002c98f2f.zip |
renamed the signal CONTACT_REMOVED to CONTACTS_REMOVED and chaned the
2005-01-21 Sivaiah Nallagatla <snallagatla@novell.com>
* gui/widgets/e-addressbook-model.[ch]
(eab_model_class_init) : renamed the signal
CONTACT_REMOVED to CONTACTS_REMOVED and chaned
the param type POINTER from INT
(remove_contact) : delete all the contacts
from the model and emit CONATCTS_REMOVED
signal instead of emitting it many times
* gui/widgets/e-addressbook-reflow-adpater.c
(e_addressbook_reflow_adapter_construct)
(remove_contacts) : renamed remove_contact to remove_contacts
and when number of conacts is more than 1 use _model_changed
instead of _remove_item
* gui/widgets/e-addressbook-table-adapter.c
(eab_table_adapter_construct)
(remove_contacts) : ditto
* gui/widgets/e-addressbook-view.c
(eab_view_new) :
(contacts_removed) : renamed contact_removed
to contacts_removed and traverese over indices
to find displayed contact indiex
fixes #71448
svn path=/trunk/; revision=28503
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-model.c')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-model.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index e6f4ecb868..da029adb19 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -42,7 +42,7 @@ enum { SEARCH_RESULT, FOLDER_BAR_MESSAGE, CONTACT_ADDED, - CONTACT_REMOVED, + CONTACTS_REMOVED, CONTACT_CHANGED, MODEL_CHANGED, STOP_STATE_CHANGED, @@ -191,9 +191,11 @@ remove_contact(EBookView *book_view, EABModel *model) { /* XXX we should keep a hash around instead of this O(n*m) loop */ - int i = 0; + gint i = 0; GList *l; + GArray *indices; + indices = g_array_new (FALSE, FALSE, sizeof (gint)); for (l = ids; l; l = l->next) { char *id = l->data; for ( i = 0; i < model->data_count; i++) { @@ -201,16 +203,15 @@ remove_contact(EBookView *book_view, g_object_unref (model->data[i]); memmove(model->data + i, model->data + i + 1, (model->data_count - i - 1) * sizeof (EContact *)); model->data_count--; - - g_signal_emit (model, - eab_model_signals [CONTACT_REMOVED], 0, - i); - + g_array_append_val (indices, i); break; } } } - + g_signal_emit (model, + eab_model_signals [CONTACTS_REMOVED], 0, + indices); + g_array_free (indices, FALSE); update_folder_bar_message (model); } @@ -367,14 +368,14 @@ eab_model_class_init (GObjectClass *object_class) eab_marshal_NONE__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - eab_model_signals [CONTACT_REMOVED] = - g_signal_new ("contact_removed", + eab_model_signals [CONTACTS_REMOVED] = + g_signal_new ("contacts_removed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EABModelClass, contact_removed), + G_STRUCT_OFFSET (EABModelClass, contacts_removed), NULL, NULL, - eab_marshal_NONE__INT, - G_TYPE_NONE, 1, G_TYPE_INT); + eab_marshal_NONE__POINTER, + G_TYPE_NONE, 1, G_TYPE_POINTER); eab_model_signals [CONTACT_CHANGED] = g_signal_new ("contact_changed", |