aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-addressbook-model.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-02-17 10:00:32 +0800
committerChris Toshok <toshok@src.gnome.org>2003-02-17 10:00:32 +0800
commit9e048335b618fea2076c690479cd655d35a56515 (patch)
treed60440f1c22cfca6281597e67ecd8f00ae2e5ab7 /addressbook/gui/widgets/e-addressbook-model.c
parentaba27fbc03e26cf04ed7d9204968317e69112640 (diff)
downloadgsoc2013-evolution-9e048335b618fea2076c690479cd655d35a56515.tar
gsoc2013-evolution-9e048335b618fea2076c690479cd655d35a56515.tar.gz
gsoc2013-evolution-9e048335b618fea2076c690479cd655d35a56515.tar.bz2
gsoc2013-evolution-9e048335b618fea2076c690479cd655d35a56515.tar.lz
gsoc2013-evolution-9e048335b618fea2076c690479cd655d35a56515.tar.xz
gsoc2013-evolution-9e048335b618fea2076c690479cd655d35a56515.tar.zst
gsoc2013-evolution-9e048335b618fea2076c690479cd655d35a56515.zip
disconnect search_started and search_result. (addressbook_compare): if
2003-02-16 Chris Toshok <toshok@ximian.com> * gui/widgets/e-addressbook-reflow-adapter.c (unlink_model): disconnect search_started and search_result. (addressbook_compare): if we're loading, just compare model positions (so we just append while loading). (remove_card): use e_reflow_model_item_removed. (search_started): new function, set loading = TRUE. (search_result): new function, set loading = FALSE and emit "comparison_changed". (e_addressbook_reflow_adapter_init): init loading and the new signal ids. (e_addressbook_reflow_adapter_construct): connect "search_started" and "search_result". * gui/widgets/e-addressbook-model.h (struct _EAddressbookModelClass): add search_started signal. * gui/widgets/e-addressbook-model.c (e_addressbook_model_class_init): new signal "search_started". (book_view_loaded): emit "search_started" after "model_changed". (remove_card): simplify this, and use CARD_REMOVED all the time, instead of just in the single card case. svn path=/trunk/; revision=19916
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-model.c')
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index df537cbdf7..782516d86a 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -39,6 +39,7 @@ enum {
enum {
WRITABLE_STATUS,
STATUS_MESSAGE,
+ SEARCH_STARTED,
SEARCH_RESULT,
FOLDER_BAR_MESSAGE,
CARD_ADDED,
@@ -201,13 +202,8 @@ remove_card(EBookView *book_view,
EAddressbookModel *model)
{
int i = 0;
- int num_deleted = 0;
GList *l;
- /* XXX this is really broken. the CARD_REMOVED signal should
- be enough for us, but the !(*@#& EReflow mess can't delete
- single objects at a time. In fact it can't remove objects
- at all. every deletion = model_changed. */
for (l = ids; l; l = l->next) {
char *id = l->data;
for ( i = 0; i < model->data_count; i++) {
@@ -216,23 +212,16 @@ remove_card(EBookView *book_view,
memmove(model->data + i, model->data + i + 1, (model->data_count - i - 1) * sizeof (ECard *));
model->data_count--;
- num_deleted++;
+ g_signal_emit (model,
+ e_addressbook_model_signals [CARD_REMOVED], 0,
+ i);
+
break;
}
}
}
- if (num_deleted == 1) {
- g_signal_emit (model,
- e_addressbook_model_signals [CARD_REMOVED], 0,
- i);
- update_folder_bar_message (model);
- }
- else if (num_deleted > 1) {
- g_signal_emit (model,
- e_addressbook_model_signals [MODEL_CHANGED], 0);
- update_folder_bar_message (model);
- }
+ update_folder_bar_message (model);
}
static void
@@ -351,6 +340,15 @@ e_addressbook_model_class_init (GObjectClass *object_class)
G_TYPE_NONE,
1, G_TYPE_POINTER);
+ e_addressbook_model_signals [SEARCH_STARTED] =
+ g_signal_new ("search_started",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EAddressbookModelClass, search_started),
+ NULL, NULL,
+ e_addressbook_marshal_NONE__NONE,
+ G_TYPE_NONE, 0);
+
e_addressbook_model_signals [SEARCH_RESULT] =
g_signal_new ("search_result",
G_OBJECT_CLASS_TYPE (object_class),
@@ -490,6 +488,8 @@ book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointe
g_signal_emit (model,
e_addressbook_model_signals [MODEL_CHANGED], 0);
g_signal_emit (model,
+ e_addressbook_model_signals [SEARCH_STARTED], 0);
+ g_signal_emit (model,
e_addressbook_model_signals [STOP_STATE_CHANGED], 0);
}