From 5c58686c8ef72be5ed8a2d4469b3556f80d4b81c Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 9 Jun 2001 06:31:55 +0000 Subject: Null terminate the strv here. (e_card_locate_match): ref here instead of 2001-06-09 Christopher James Lahey * backend/ebook/e-card-compare.c (use_common_book_cb): Null terminate the strv here. (e_card_locate_match): ref here instead of unref. * backend/ebook/e-card-simple.c (e_card_simple_get): Handle a NULL card here. * contact-editor/Makefile.am (INCLUDES), gui/widgets/Makefile.am (INCLUDES): Added addressbook/gui/merging here. * contact-editor/e-contact-quick-add.c (book_ready_cb), gui/component/addressbook-component.c (dnd_drop_book_open_cb), gui/widgets/e-addressbook-table-adapter.c (addressbook_append_row), gui/widgets/e-addressbook-util.c (add_card_cb), gui/widgets/e-addressbook-view.c (selection_received), gui/widgets/e-minicard-control.c (book_open_cb): Use e_card_merging_book_add_card instead of e_book_add_card here. * gui/Makefile.am (SUBDIRS): Added merging. * gui/component/Makefile.am (evolution_addressbook_LDADD), gui/widgets/Makefile.am (minicard_test_LDADD, minicard_widget_test_LDADD): Added libecardmerging.a here. * gui/merging/, gui/merging/.cvsignore, gui/merging/Makefile.am: New addressbook library. * gui/merging/e-card-duplicate-detected.glade: Glade file for duplicate detected dialog. * gui/merging/e-card-merging.c, gui/merging/e-card-merging.h: New files for detecting duplicates before adding and putting up a dialog if duplicates are found. * gui/widgets/e-minicard-view.c: Include e-addressbook-util.h here. svn path=/trunk/; revision=10170 --- addressbook/ChangeLog | 40 ++++ addressbook/backend/ebook/e-card-compare.c | 4 +- addressbook/backend/ebook/e-card-simple.c | 60 +++-- addressbook/contact-editor/Makefile.am | 1 + addressbook/contact-editor/e-contact-quick-add.c | 3 +- addressbook/gui/Makefile.am | 2 +- addressbook/gui/component/Makefile.am | 1 + addressbook/gui/component/addressbook-component.c | 3 +- addressbook/gui/contact-editor/Makefile.am | 1 + .../gui/contact-editor/e-contact-quick-add.c | 3 +- addressbook/gui/merging/.cvsignore | 6 + addressbook/gui/merging/Makefile.am | 22 ++ .../gui/merging/e-card-duplicate-detected.glade | 255 +++++++++++++++++++++ addressbook/gui/merging/e-card-merging.c | 100 ++++++++ addressbook/gui/merging/e-card-merging.h | 27 +++ addressbook/gui/widgets/Makefile.am | 10 +- .../gui/widgets/e-addressbook-table-adapter.c | 3 +- addressbook/gui/widgets/e-addressbook-util.c | 3 +- addressbook/gui/widgets/e-addressbook-view.c | 3 +- addressbook/gui/widgets/e-minicard-control.c | 3 +- addressbook/gui/widgets/e-minicard-view.c | 2 +- 21 files changed, 512 insertions(+), 40 deletions(-) create mode 100644 addressbook/gui/merging/.cvsignore create mode 100644 addressbook/gui/merging/Makefile.am create mode 100644 addressbook/gui/merging/e-card-duplicate-detected.glade create mode 100644 addressbook/gui/merging/e-card-merging.c create mode 100644 addressbook/gui/merging/e-card-merging.h (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 77769698ff..a6621db265 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,43 @@ +2001-06-09 Christopher James Lahey + + * backend/ebook/e-card-compare.c (use_common_book_cb): Null + terminate the strv here. + (e_card_locate_match): ref here instead of unref. + + * backend/ebook/e-card-simple.c (e_card_simple_get): Handle a NULL + card here. + + * contact-editor/Makefile.am (INCLUDES), gui/widgets/Makefile.am + (INCLUDES): Added addressbook/gui/merging here. + + * contact-editor/e-contact-quick-add.c (book_ready_cb), + gui/component/addressbook-component.c (dnd_drop_book_open_cb), + gui/widgets/e-addressbook-table-adapter.c + (addressbook_append_row), gui/widgets/e-addressbook-util.c + (add_card_cb), gui/widgets/e-addressbook-view.c + (selection_received), gui/widgets/e-minicard-control.c + (book_open_cb): Use e_card_merging_book_add_card instead of + e_book_add_card here. + + * gui/Makefile.am (SUBDIRS): Added merging. + + * gui/component/Makefile.am (evolution_addressbook_LDADD), + gui/widgets/Makefile.am (minicard_test_LDADD, + minicard_widget_test_LDADD): Added libecardmerging.a here. + + * gui/merging/, gui/merging/.cvsignore, gui/merging/Makefile.am: + New addressbook library. + + * gui/merging/e-card-duplicate-detected.glade: Glade file for + duplicate detected dialog. + + * gui/merging/e-card-merging.c, gui/merging/e-card-merging.h: New + files for detecting duplicates before adding and putting up a + dialog if duplicates are found. + + * gui/widgets/e-minicard-view.c: Include e-addressbook-util.h + here. + 2001-06-08 Chris Toshok * contact-editor/e-contact-editor.c (e_contact_editor_new): remove diff --git a/addressbook/backend/ebook/e-card-compare.c b/addressbook/backend/ebook/e-card-compare.c index fc80d5e6c6..f249c1727b 100644 --- a/addressbook/backend/ebook/e-card-compare.c +++ b/addressbook/backend/ebook/e-card-compare.c @@ -419,7 +419,7 @@ use_common_book_cb (EBook *book, gpointer closure) /* Build up our full query from the parts. */ - + query_parts[p] = NULL; qj = g_strjoinv (" ", query_parts); if (p > 0) { query = g_strdup_printf ("(or %s)", qj); @@ -446,7 +446,7 @@ e_card_locate_match (ECard *card, ECardMatchQueryCallback cb, gpointer closure) info = g_new (MatchSearchInfo, 1); info->card = card; - gtk_object_unref (GTK_OBJECT (card)); + gtk_object_ref (GTK_OBJECT (card)); info->cb = cb; info->closure = closure; diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c index f7550017a0..ed10a56685 100644 --- a/addressbook/backend/ebook/e-card-simple.c +++ b/addressbook/backend/ebook/e-card-simple.c @@ -727,15 +727,21 @@ char *e_card_simple_get (ECardSimple *simple, ECardName *name; switch(type) { case E_CARD_SIMPLE_INTERNAL_TYPE_STRING: - gtk_object_get(GTK_OBJECT(simple->card), - field_data[field].ecard_field, &string, - NULL); - return g_strdup(string); + if (simple->card) { + gtk_object_get(GTK_OBJECT(simple->card), + field_data[field].ecard_field, &string, + NULL); + return g_strdup(string); + } else + return NULL; case E_CARD_SIMPLE_INTERNAL_TYPE_DATE: - gtk_object_get(GTK_OBJECT(simple->card), - field_data[field].ecard_field, &date, - NULL); - return NULL; /* FIXME!!!! */ + if (simple->card) { + gtk_object_get(GTK_OBJECT(simple->card), + field_data[field].ecard_field, &date, + NULL); + return NULL; /* FIXME!!!! */ + } else + return NULL; case E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS: addr = e_card_simple_get_address(simple, field_data[field].list_type_index); @@ -757,24 +763,30 @@ char *e_card_simple_get (ECardSimple *simple, case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL: switch (field) { case E_CARD_SIMPLE_FIELD_NAME_OR_ORG: - gtk_object_get(GTK_OBJECT(simple->card), - "full_name", &string, - NULL); - if (string && *string) + if (simple->card) { + gtk_object_get(GTK_OBJECT(simple->card), + "full_name", &string, + NULL); + if (string && *string) + return g_strdup(string); + gtk_object_get(GTK_OBJECT(simple->card), + "org", &string, + NULL); + if (string && *string) + return g_strdup(string); + string = e_card_simple_get_email(simple, + E_CARD_SIMPLE_EMAIL_ID_EMAIL); return g_strdup(string); - gtk_object_get(GTK_OBJECT(simple->card), - "org", &string, - NULL); - if (string && *string) - return g_strdup(string); - string = e_card_simple_get_email(simple, - E_CARD_SIMPLE_EMAIL_ID_EMAIL); - return g_strdup(string); + } else + return NULL; case E_CARD_SIMPLE_FIELD_FAMILY_NAME: - gtk_object_get (GTK_OBJECT(simple->card), - "name", &name, - NULL); - return g_strdup (name->family); + if (simple->card) { + gtk_object_get (GTK_OBJECT(simple->card), + "name", &name, + NULL); + return g_strdup (name->family); + } else + return NULL; default: return NULL; } diff --git a/addressbook/contact-editor/Makefile.am b/addressbook/contact-editor/Makefile.am index 700be0ff35..47a79c7255 100644 --- a/addressbook/contact-editor/Makefile.am +++ b/addressbook/contact-editor/Makefile.am @@ -4,6 +4,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/addressbook/ \ -I$(top_srcdir)/addressbook/backend \ + -I$(top_srcdir)/addressbook/gui/merging \ -I$(top_srcdir)/widgets/e-table \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DDATADIR=\""$(datadir)"\" \ diff --git a/addressbook/contact-editor/e-contact-quick-add.c b/addressbook/contact-editor/e-contact-quick-add.c index f9556f6758..edc8bae5cc 100644 --- a/addressbook/contact-editor/e-contact-quick-add.c +++ b/addressbook/contact-editor/e-contact-quick-add.c @@ -42,6 +42,7 @@ #include #include "e-contact-editor.h" #include "e-contact-quick-add.h" +#include "e-card-merging.h" static void e_card_quick_set_name (ECard *card, const gchar *str) @@ -85,7 +86,7 @@ book_ready_cb (EBook *book, EBookStatus status, gpointer user_data) gpointer cb_user_data = gtk_object_get_data (GTK_OBJECT (card), "e-contact-quick-add-user-data"); if (status == E_BOOK_STATUS_SUCCESS) { - e_book_add_card (book, card, NULL, NULL); + e_card_merging_book_add_card (book, card, NULL, NULL); if (cb) cb (card, cb_user_data); } else { diff --git a/addressbook/gui/Makefile.am b/addressbook/gui/Makefile.am index cd8fe38705..8ba306c0d3 100644 --- a/addressbook/gui/Makefile.am +++ b/addressbook/gui/Makefile.am @@ -1 +1 @@ -SUBDIRS = widgets search component +SUBDIRS = merging widgets search component diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am index e3f444d500..6f38d86436 100644 --- a/addressbook/gui/component/Makefile.am +++ b/addressbook/gui/component/Makefile.am @@ -54,6 +54,7 @@ evolution_addressbook_LDADD = \ $(top_builddir)/widgets/misc/libemiscwidgets.a \ $(top_builddir)/addressbook/printing/libecontactprint.a \ $(top_builddir)/addressbook/gui/search/libeaddressbooksearch.a \ + $(top_builddir)/addressbook/gui/merging/libecardmerging.a \ $(top_builddir)/filter/libfilter.la \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/widgets/menus/libmenus.la diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index f27384dd36..6274eea50c 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -41,6 +41,7 @@ #include "addressbook-storage.h" #include "addressbook-component.h" #include "addressbook.h" +#include "addressbook/gui/merging/e-card-merging.h" @@ -299,7 +300,7 @@ dnd_drop_book_open_cb (EBook *book, EBookStatus status, GList *card_list) for (l = card_list; l; l = l->next) { ECard *card = l->data; - e_book_add_card (book, card, NULL /* XXX */, NULL); + e_card_merging_book_add_card (book, card, NULL /* XXX */, NULL); } } diff --git a/addressbook/gui/contact-editor/Makefile.am b/addressbook/gui/contact-editor/Makefile.am index 700be0ff35..47a79c7255 100644 --- a/addressbook/gui/contact-editor/Makefile.am +++ b/addressbook/gui/contact-editor/Makefile.am @@ -4,6 +4,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/addressbook/ \ -I$(top_srcdir)/addressbook/backend \ + -I$(top_srcdir)/addressbook/gui/merging \ -I$(top_srcdir)/widgets/e-table \ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ -DDATADIR=\""$(datadir)"\" \ diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index f9556f6758..edc8bae5cc 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -42,6 +42,7 @@ #include #include "e-contact-editor.h" #include "e-contact-quick-add.h" +#include "e-card-merging.h" static void e_card_quick_set_name (ECard *card, const gchar *str) @@ -85,7 +86,7 @@ book_ready_cb (EBook *book, EBookStatus status, gpointer user_data) gpointer cb_user_data = gtk_object_get_data (GTK_OBJECT (card), "e-contact-quick-add-user-data"); if (status == E_BOOK_STATUS_SUCCESS) { - e_book_add_card (book, card, NULL, NULL); + e_card_merging_book_add_card (book, card, NULL, NULL); if (cb) cb (card, cb_user_data); } else { diff --git a/addressbook/gui/merging/.cvsignore b/addressbook/gui/merging/.cvsignore new file mode 100644 index 0000000000..09980ae6ba --- /dev/null +++ b/addressbook/gui/merging/.cvsignore @@ -0,0 +1,6 @@ +.deps +.libs +Makefile +Makefile.in +*.lo +*.la diff --git a/addressbook/gui/merging/Makefile.am b/addressbook/gui/merging/Makefile.am new file mode 100644 index 0000000000..493edc0002 --- /dev/null +++ b/addressbook/gui/merging/Makefile.am @@ -0,0 +1,22 @@ +INCLUDES = \ + -DG_LOG_DOMAIN=\"e-card-gui\" \ + -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ + -DEVOLUTION_DATADIR=\""$(datadir)"\" \ + -I$(top_srcdir) \ + -I$(top_srcdir)/addressbook/backend/ebook \ + $(BONOBO_GNOME_CFLAGS) \ + $(EXTRA_GNOME_CFLAGS) + +noinst_LIBRARIES = \ + libecardmerging.a + +libecardmerging_a_SOURCES = \ + e-card-merging.c \ + e-card-merging.h + + +gladedir = $(datadir)/evolution/glade +glade_DATA = e-card-duplicate-detected.glade + +EXTRA_DIST = \ + $(glade_DATA) diff --git a/addressbook/gui/merging/e-card-duplicate-detected.glade b/addressbook/gui/merging/e-card-duplicate-detected.glade new file mode 100644 index 0000000000..bc6624e8fd --- /dev/null +++ b/addressbook/gui/merging/e-card-duplicate-detected.glade @@ -0,0 +1,255 @@ + + + + + e-card-duplicate-detected + e-card-duplicate-detected + + src + pixmaps + C + True + True + True + False + False + False + True + + + + GnomeDialog + dialog-duplicate-contact + Duplicate Contact Detected + GTK_WINDOW_POPUP + GTK_WIN_POS_NONE + False + False + True + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox1 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area1 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button3 + True + True + + GNOME_STOCK_PIXMAP_ADD + + + + GtkButton + button4 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkTable + table1 + 5 + 2 + False + 6 + 6 + + 0 + True + True + + + + Custom + custom-old-card + e_card_merging_create_old_card + 0 + 0 + Fri, 08 Jun 2001 01:33:22 GMT + + 1 + 2 + 4 + 5 + 0 + 0 + True + True + False + False + True + True + + + + + GtkLabel + label1 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + + GtkLabel + label3 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 3 + 4 + 0 + 0 + True + False + False + False + True + True + + + + + GtkLabel + label4 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + Custom + custom-new-card + e_card_merging_create_old_card + 0 + 0 + Fri, 08 Jun 2001 01:33:22 GMT + + 1 + 2 + 2 + 3 + 0 + 0 + True + True + False + False + True + True + + + + + GtkAlignment + alignment1 + 0.5 + 0 + 1 + 0 + + 0 + 1 + 0 + 5 + 0 + 0 + False + False + False + False + True + True + + + + Custom + custom2 + e_create_image_widget + malehead.png + 0 + 0 + Fri, 08 Jun 2001 00:18:39 GMT + + + + + + + diff --git a/addressbook/gui/merging/e-card-merging.c b/addressbook/gui/merging/e-card-merging.c new file mode 100644 index 0000000000..701ab69da9 --- /dev/null +++ b/addressbook/gui/merging/e-card-merging.c @@ -0,0 +1,100 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Code for checking for duplicates when doing ECard work. + * + * Author: + * Christopher James Lahey + * + * Copyright 2001, Ximian, Inc. + */ + +#include + +#include "e-card-merging.h" +#include +#include "e-card-compare.h" +#include +#include +#include "addressbook/gui/widgets/e-minicard-widget.h" + +typedef struct { + EBook *book; + ECard *card; + EBookIdCallback cb; + gpointer closure; +} ECardMergingLookup; + +static void +clicked (GnomeDialog *dialog, int button, ECardMergingLookup *lookup) +{ + switch (button) { + case 0: + e_book_add_card (lookup->book, lookup->card, lookup->cb, lookup->closure); + break; + case 1: + if (lookup->cb) + lookup->cb (lookup->book, E_BOOK_STATUS_CANCELLED, NULL, lookup->closure); + break; + } + g_free (lookup); + gnome_dialog_close (dialog); +} + +static void +match_query_callback (ECard *card, ECard *match, ECardMatchType type, gpointer closure) +{ + ECardMergingLookup *lookup = closure; + if (type == E_CARD_MATCH_NONE) { + e_book_add_card (lookup->book, card, lookup->cb, lookup->closure); + g_free (lookup); + } else { + GladeXML *ui = glade_xml_new (EVOLUTION_GLADEDIR "/e-card-duplicate-detected.glade", NULL); + GtkWidget *widget; + + widget = glade_xml_get_widget (ui, "custom-old-card"); + gtk_object_set (GTK_OBJECT (widget), + "card", match, + NULL); + + widget = glade_xml_get_widget (ui, "custom-new-card"); + gtk_object_set (GTK_OBJECT (widget), + "card", card, + NULL); + + widget = glade_xml_get_widget (ui, "dialog-duplicate-contact"); + + gtk_signal_connect (GTK_OBJECT (widget), "clicked", + GTK_SIGNAL_FUNC (clicked), lookup); + } +} + +gboolean +e_card_merging_book_add_card (EBook *book, + ECard *card, + EBookIdCallback cb, + gpointer closure) +{ + ECardMergingLookup *lookup; + lookup = g_new (ECardMergingLookup, 1); + + lookup->book = book; + lookup->card = card; + lookup->cb = cb; + lookup->closure = closure; + + e_card_locate_match (card, match_query_callback, lookup); + return TRUE; +} + +GtkWidget * +e_card_merging_create_old_card(gchar *name, + gchar *string1, gchar *string2, + gint int1, gint int2); + +GtkWidget * +e_card_merging_create_old_card(gchar *name, + gchar *string1, gchar *string2, + gint int1, gint int2) +{ + return e_minicard_widget_new (); +} diff --git a/addressbook/gui/merging/e-card-merging.h b/addressbook/gui/merging/e-card-merging.h new file mode 100644 index 0000000000..022cad0099 --- /dev/null +++ b/addressbook/gui/merging/e-card-merging.h @@ -0,0 +1,27 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * The Evolution addressbook client object. + * + * Author: + * Christopher James Lahey + * + * Copyright 2001, Ximian, Inc. + */ + +#ifndef __E_CARD_MERGING_H__ +#define __E_CARD_MERGING_H__ + +#include + +#include + +BEGIN_GNOME_DECLS + +gboolean e_card_merging_book_add_card (EBook *book, + ECard *card, + EBookIdCallback cb, + gpointer closure); + +END_GNOME_DECLS + +#endif /* ! __E_CARD_MERGING_H__ */ diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am index 92b925d199..a375965a66 100644 --- a/addressbook/gui/widgets/Makefile.am +++ b/addressbook/gui/widgets/Makefile.am @@ -5,10 +5,7 @@ INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/addressbook/backend/ebook \ -I$(top_srcdir)/addressbook/contact-editor \ - -I$(top_srcdir)/widgets/e-text \ - -I$(top_srcdir)/widgets/e-table \ - -I$(top_srcdir)/widgets/e-reflow \ - -I$(top_srcdir)/widgets/e-table \ + -I$(top_srcdir)/addressbook/gui/merging \ -I$(top_srcdir)/widgets/misc \ $(BONOBO_GNOME_CFLAGS) \ $(EXTRA_GNOME_CFLAGS) @@ -71,11 +68,13 @@ minicard_test_LDADD = \ $(top_builddir)/e-util/ename/libename.la \ $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ $(top_builddir)/addressbook/printing/libecontactprint.a \ + $(top_builddir)/addressbook/gui/merging/libecardmerging.a \ $(top_builddir)/widgets/misc/libemiscwidgets.a \ $(top_builddir)/e-util/libeutil.la \ $(EXTRA_GNOME_LIBS) \ $(BONOBO_GNOME_LIBS) \ - $(GNOME_PRINT_LIBS) + $(GNOME_PRINT_LIBS) \ + libeminicard.a #reflow_test_SOURCES = \ # test-reflow.c @@ -123,6 +122,7 @@ minicard_widget_test_LDADD = \ $(top_builddir)/addressbook/printing/libecontactprint.a \ $(top_builddir)/widgets/misc/libemiscwidgets.a \ $(top_builddir)/e-util/libeutil.la \ + $(top_builddir)/addressbook/gui/merging/libecardmerging.a \ $(EXTRA_GNOME_LIBS) \ $(BONOBO_GNOME_LIBS) \ $(GNOME_PRINT_LIBS) diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index 5ddc8acdfb..9557046afe 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -3,6 +3,7 @@ #include #include "e-addressbook-model.h" #include "e-addressbook-table-adapter.h" +#include "e-card-merging.h" #include "e-addressbook-util.h" #include #include @@ -169,7 +170,7 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) e_card_simple_set(simple, col, val); } e_card_simple_sync_card(simple); - e_book_add_card (e_addressbook_model_get_ebook (priv->model), card, NULL, NULL); + e_card_merging_book_add_card (e_addressbook_model_get_ebook (priv->model), card, NULL, NULL); gtk_object_unref(GTK_OBJECT(simple)); gtk_object_unref(GTK_OBJECT(card)); } diff --git a/addressbook/gui/widgets/e-addressbook-util.c b/addressbook/gui/widgets/e-addressbook-util.c index 55d3ce503e..6db628c412 100644 --- a/addressbook/gui/widgets/e-addressbook-util.c +++ b/addressbook/gui/widgets/e-addressbook-util.c @@ -26,6 +26,7 @@ #include "e-addressbook-util.h" #include "e-contact-editor.h" +#include "e-card-merging.h" void e_addressbook_error_dialog (const gchar *msg, EBookStatus status) @@ -84,7 +85,7 @@ add_card_cb (EContactEditor *ce, ECard *card, gpointer data) EBook *book; book = E_BOOK (data); - e_book_add_card (book, card, card_added_cb, NULL); + e_card_merging_book_add_card (book, card, card_added_cb, NULL); } /* Callback for the commit_card signal from the contact editor */ diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 99dc600e94..99672f2ede 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -53,6 +53,7 @@ #include "e-addressbook-reflow-adapter.h" #include "e-minicard-view-widget.h" #include "e-contact-save-as.h" +#include "e-card-merging.h" #include "e-contact-editor.h" @@ -1168,7 +1169,7 @@ selection_received (GtkWidget *invisible, for (l = card_list; l; l = l->next) { ECard *card = l->data; - e_book_add_card (view->book, card, NULL /* XXX */, NULL); + e_card_merging_book_add_card (view->book, card, NULL /* XXX */, NULL); } g_list_foreach (card_list, (GFunc)gtk_object_unref, NULL); diff --git a/addressbook/gui/widgets/e-minicard-control.c b/addressbook/gui/widgets/e-minicard-control.c index ab1356d1d5..7802dd0b20 100644 --- a/addressbook/gui/widgets/e-minicard-control.c +++ b/addressbook/gui/widgets/e-minicard-control.c @@ -19,6 +19,7 @@ #include "e-minicard-control.h" #include "e-minicard-widget.h" +#include "e-card-merging.h" #if 0 enum { @@ -225,7 +226,7 @@ static void book_open_cb (EBook *book, EBookStatus status, gpointer closure) { ECard *card = closure; - e_book_add_card(book, card, NULL, NULL); + e_card_merging_book_add_card(book, card, NULL, NULL); gtk_object_unref(GTK_OBJECT(card)); } diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 66b25401a5..a85656a743 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -24,7 +24,7 @@ #include "e-minicard-view.h" -#include "e-contact-editor.h" +#include "e-addressbook-util.h" #include #include -- cgit v1.2.3