aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-22 08:00:30 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-06-03 11:00:39 +0800
commitb99b09e4570d7b24c23fc8b97606eaa9057bbd5c (patch)
treee8a801fcfea0a83a1218ad448936f451dbc60a9b /addressbook
parent70805074799774f97473dafbed444c8a0b3b68e1 (diff)
downloadgsoc2013-evolution-b99b09e4570d7b24c23fc8b97606eaa9057bbd5c.tar.gz
gsoc2013-evolution-b99b09e4570d7b24c23fc8b97606eaa9057bbd5c.tar.zst
gsoc2013-evolution-b99b09e4570d7b24c23fc8b97606eaa9057bbd5c.zip
Adapt addressbook/gui/merging to the new ESource API.
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/merging/eab-contact-compare.c24
-rw-r--r--addressbook/gui/merging/eab-contact-compare.h7
-rw-r--r--addressbook/gui/merging/eab-contact-merging.c22
-rw-r--r--addressbook/gui/merging/eab-contact-merging.h10
4 files changed, 41 insertions, 22 deletions
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c
index 231a14281c..872648ca42 100644
--- a/addressbook/gui/merging/eab-contact-compare.c
+++ b/addressbook/gui/merging/eab-contact-compare.c
@@ -28,6 +28,7 @@
#include <ctype.h>
#include <string.h>
#include <libebook/e-book-query.h>
+#include <libedataserver/e-source-registry.h>
#include <libedataserverui/e-client-utils.h>
#include "addressbook/util/eab-book-util.h"
#include "eab-contact-compare.h"
@@ -562,7 +563,6 @@ eab_contact_compare (EContact *contact1,
typedef struct _MatchSearchInfo MatchSearchInfo;
struct _MatchSearchInfo {
- ESourceList *source_list;
EContact *contact;
GList *avoid;
EABContactMatchQueryCallback cb;
@@ -573,9 +573,6 @@ static void
match_search_info_free (MatchSearchInfo *info)
{
if (info) {
- if (info->source_list != NULL)
- g_object_unref (info->source_list);
-
g_object_unref (info->contact);
/* This should already have been deallocated, but just in case... */
@@ -786,15 +783,18 @@ book_loaded_cb (GObject *source_object,
}
void
-eab_contact_locate_match (EContact *contact,
+eab_contact_locate_match (ESourceRegistry *registry,
+ EContact *contact,
EABContactMatchQueryCallback cb,
gpointer closure)
{
- eab_contact_locate_match_full (NULL, contact, NULL, cb, closure);
+ eab_contact_locate_match_full (
+ registry, NULL, contact, NULL, cb, closure);
}
/**
* e_contact_locate_match_full:
+ * @registry: an #ESourceRegistry
* @book: The book to look in. If this is NULL, use the default
* addressbook.
* @contact: The contact to compare to.
@@ -805,7 +805,8 @@ eab_contact_locate_match (EContact *contact,
* Look for the best match and return it using the EABContactMatchQueryCallback.
**/
void
-eab_contact_locate_match_full (EBookClient *book_client,
+eab_contact_locate_match_full (ESourceRegistry *registry,
+ EBookClient *book_client,
EContact *contact,
GList *avoid,
EABContactMatchQueryCallback cb,
@@ -814,6 +815,7 @@ eab_contact_locate_match_full (EBookClient *book_client,
MatchSearchInfo *info;
ESource *source;
+ g_return_if_fail (E_IS_SOURCE_REGISTRY (registry));
g_return_if_fail (E_IS_CONTACT (contact));
g_return_if_fail (cb != NULL);
@@ -829,14 +831,12 @@ eab_contact_locate_match_full (EBookClient *book_client,
return;
}
- if (!e_book_client_get_sources (&info->source_list, NULL))
- return;
-
- source = e_source_list_peek_default_source (info->source_list);
+ source = e_source_registry_ref_default_address_book (registry);
e_client_utils_open_new (
source, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL,
- e_client_utils_authenticate_handler, NULL,
book_loaded_cb, info);
+
+ g_object_unref (source);
}
diff --git a/addressbook/gui/merging/eab-contact-compare.h b/addressbook/gui/merging/eab-contact-compare.h
index 8c07a56f08..30c1c2d0cf 100644
--- a/addressbook/gui/merging/eab-contact-compare.h
+++ b/addressbook/gui/merging/eab-contact-compare.h
@@ -28,6 +28,7 @@
#include <libebook/e-contact.h>
#include <libebook/e-book-client.h>
+#include <libedataserver/e-source-registry.h>
typedef enum {
EAB_CONTACT_MATCH_NOT_APPLICABLE = 0,
@@ -87,10 +88,12 @@ EABContactMatchType
eab_contact_compare (EContact *contact1,
EContact *contact2);
-void eab_contact_locate_match (EContact *contact,
+void eab_contact_locate_match (ESourceRegistry *registry,
+ EContact *contact,
EABContactMatchQueryCallback cb,
gpointer closure);
-void eab_contact_locate_match_full (EBookClient *book_client,
+void eab_contact_locate_match_full (ESourceRegistry *registry,
+ EBookClient *book_client,
EContact *contact,
GList *avoid,
EABContactMatchQueryCallback cb,
diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c
index f13b66d1c4..cbcb376734 100644
--- a/addressbook/gui/merging/eab-contact-merging.c
+++ b/addressbook/gui/merging/eab-contact-merging.c
@@ -45,6 +45,7 @@ typedef enum {
typedef struct {
EContactMergingOpType op;
+ ESourceRegistry *registry;
EBookClient *book_client;
/*contact is the new contact which the user has tried to add to the addressbook*/
EContact *contact;
@@ -74,7 +75,7 @@ add_lookup (EContactMergingLookup *lookup)
if (running_merge_requests < SIMULTANEOUS_MERGING_REQUESTS) {
running_merge_requests++;
eab_contact_locate_match_full (
- lookup->book_client,
+ lookup->registry, lookup->book_client,
lookup->contact, lookup->avoid,
match_query_callback, lookup);
}
@@ -100,7 +101,7 @@ finished_lookup (void)
running_merge_requests++;
eab_contact_locate_match_full (
- lookup->book_client,
+ lookup->registry, lookup->book_client,
lookup->contact, lookup->avoid,
match_query_callback, lookup);
}
@@ -109,6 +110,7 @@ finished_lookup (void)
static void
free_lookup (EContactMergingLookup *lookup)
{
+ g_object_unref (lookup->registry);
g_object_unref (lookup->book_client);
g_object_unref (lookup->contact);
g_list_free (lookup->avoid);
@@ -674,16 +676,20 @@ match_query_callback (EContact *contact,
}
gboolean
-eab_merging_book_add_contact (EBookClient *book_client,
+eab_merging_book_add_contact (ESourceRegistry *registry,
+ EBookClient *book_client,
EContact *contact,
EABMergingIdAsyncCallback cb,
gpointer closure)
{
EContactMergingLookup *lookup;
+ g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), FALSE);
+
lookup = g_new (EContactMergingLookup, 1);
lookup->op = E_CONTACT_MERGING_ADD;
+ lookup->registry = g_object_ref (registry);
lookup->book_client = g_object_ref (book_client);
lookup->contact = g_object_ref (contact);
lookup->id_cb = cb;
@@ -697,16 +703,20 @@ eab_merging_book_add_contact (EBookClient *book_client,
}
gboolean
-eab_merging_book_modify_contact (EBookClient *book_client,
+eab_merging_book_modify_contact (ESourceRegistry *registry,
+ EBookClient *book_client,
EContact *contact,
EABMergingAsyncCallback cb,
gpointer closure)
{
EContactMergingLookup *lookup;
+ g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), FALSE);
+
lookup = g_new (EContactMergingLookup, 1);
lookup->op = E_CONTACT_MERGING_COMMIT;
+ lookup->registry = g_object_ref (registry);
lookup->book_client = g_object_ref (book_client);
lookup->contact = g_object_ref (contact);
lookup->cb = cb;
@@ -720,7 +730,8 @@ eab_merging_book_modify_contact (EBookClient *book_client,
}
gboolean
-eab_merging_book_find_contact (EBookClient *book_client,
+eab_merging_book_find_contact (ESourceRegistry *registry,
+ EBookClient *book_client,
EContact *contact,
EABMergingContactAsyncCallback cb,
gpointer closure)
@@ -730,6 +741,7 @@ eab_merging_book_find_contact (EBookClient *book_client,
lookup = g_new (EContactMergingLookup, 1);
lookup->op = E_CONTACT_MERGING_FIND;
+ lookup->registry = g_object_ref (registry);
lookup->book_client = g_object_ref (book_client);
lookup->contact = g_object_ref (contact);
lookup->c_cb = cb;
diff --git a/addressbook/gui/merging/eab-contact-merging.h b/addressbook/gui/merging/eab-contact-merging.h
index a922d6b9fb..a4f62e80c0 100644
--- a/addressbook/gui/merging/eab-contact-merging.h
+++ b/addressbook/gui/merging/eab-contact-merging.h
@@ -27,6 +27,7 @@
#define __E_CONTACT_MERGING_H__
#include <libebook/e-book-client.h>
+#include <libedataserver/e-source-registry.h>
G_BEGIN_DECLS
@@ -43,17 +44,20 @@ typedef void (*EABMergingContactAsyncCallback)
EContact *contact,
gpointer closure);
-gboolean eab_merging_book_add_contact (EBookClient *book_client,
+gboolean eab_merging_book_add_contact (ESourceRegistry *registry,
+ EBookClient *book_client,
EContact *contact,
EABMergingIdAsyncCallback cb,
gpointer closure);
-gboolean eab_merging_book_modify_contact (EBookClient *book_client,
+gboolean eab_merging_book_modify_contact (ESourceRegistry *registry,
+ EBookClient *book_client,
EContact *contact,
EABMergingAsyncCallback cb,
gpointer closure);
-gboolean eab_merging_book_find_contact (EBookClient *book_client,
+gboolean eab_merging_book_find_contact (ESourceRegistry *registry,
+ EBookClient *book_client,
EContact *contact,
EABMergingContactAsyncCallback cb,
gpointer closure);
>6-46/+18 * - Remove HAVE_ESOUND/USE_ESOUND block, this is long time abandonedpav2009-01-081-5/+0 * - Remove conditional checks for FreeBSD 5.x and olderpav2009-01-061-7/+1 * - remove japenese/msdosfs: only for 5.x [1]pgollucci2008-12-2826-1081/+0 * - use DOCSDIR macroitetcu2008-11-182-5/+5 * Update to Adobe Reader 8.1.3.hrs2008-11-081-3/+3 * - Add "listenaddr 127.0.0.1" to {c|t|k}serverc.hrs2008-11-011-1/+0 * Fix file mode on deinstall, not install.hrs2008-10-312-2/+3 * - Fix mode of ${LOCALBASE}/etc/xpdfrc.hrs2008-10-311-2/+2 * - Install each localized xpdfrc separately and use "include"hrs2008-10-314-38/+34 * - Style clean-ups.hrs2008-10-274-16/+15 * Remove ports of Adobe Reader 7 and the localized versions because ofhrs2008-09-063-22/+0 * * print/ghostscript-* and related ports have been renamed in thehrs2008-09-063-32/+0 * The KDE FreeBSD team is proud to announce the release of KDE 4.1.1miwi2008-09-032-9/+6 * The KDE FreeBSD team is proud to announce the releasemiwi2008-08-291-3/+3 * Conversion from (now defunct) autoconf-2.61 to autoconf-2.62ade2008-08-202-4/+4 * - Fix INDEXmiwi2008-08-184-173/+316 * The KDE FreeBSD team is proud to announce the releasemiwi2008-08-184-266/+182 * Update to 11.5perky2008-08-142-6/+5 * The KDE FreeBSD team is proud to announce the release of KDE 4.1.0miwi2008-08-105-266/+183 * - Update to qt 4.4.1miwi2008-08-053-17/+15 * PHP Documentation in these language has been removed from the distribution.edwin2008-08-042-14/+0 * - Remove USE_GCC where it can be satisfied with base compiler on followingpav2008-07-251-1/+0 * Update to 8.1.2 Security Update 1. Quoted from the advisory:hrs2008-07-211-3/+3 * - Fix typo on Makefile.lippe2008-07-181-1/+1 * - s/PREFIX/LOCALBASE/ in DEPENDSitetcu2008-06-292-14/+16 * - Update to 0.1.1.20080329.lippe2008-06-213-7/+8 * - Fix pkg-plist in NOPORTDOCS case.lippe2008-06-162-23/+24 * ko.TeX is a collection of LaTeX packages made by Koaunghi Un, Dohyun Kimlippe2008-06-145-0/+7171 * ko.TeX is a collection of LaTeX packages made by Koaunghi Un, Dohyun Kimlippe2008-06-145-0/+237 * ko.TeX is a collection of LaTeX packages made by Koaunghi Un, Dohyun Kimlippe2008-06-145-0/+6458 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-0610-9/+10 * Update 0.99.2perky2008-05-302-5/+5 * Update to 0.0.8.itetcu2008-04-226-14/+28 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-2015-50/+49 * Update to 8.1.2. Bug fixes and enhancements can be found athrs2008-04-141-3/+3 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-253-5/+2 * - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-243-5/+2 * Update to Qt 4.3.4lofi2008-03-142-5/+3 * Reset relaxbsd@gmail.com due to maintainer-timeouts.linimon2008-03-021-1/+1 * - Update to 0.0.7rafan2008-02-074-26/+14 * To use termios.cjh2008-02-042-6/+85 * Update to 0.99.1perky2008-01-222-5/+5 * Avoid the need for running autoconf by touching configure.arved2008-01-121-2/+5 * Add Adobe Reader 8.1.1 and localized versions (total 15hrs2008-01-053-0/+19 * Update to 0.19perky2007-12-173-58/+52 * - Chase libhangul updatepav2007-12-151-2/+2 * - Update to 0.0.6pav2007-12-155-30/+41 * Update to KDE 3.5.8lofi2007-10-304-6/+488 * Presenting GNOME 2.20.1 and all related works for FreeBSD. The officialmarcus2007-10-253-54/+56 * Remove expired Emacs ports and the surrounding expired ports:vd2007-10-143-53/+0 * Replace all INSTALL_DATA/INSTALL_SCRIPT and INSTALL_PROGRAM/STRIP=edwin2007-10-071-1/+2 * Remove support for OSVERSION < 5edwin2007-10-041-4/+1 * Switch autoconf dependencies from 2.53 or 2.59 to 2.61.linimon2007-09-302-5/+5 * Update to Qt 4.3.1.lofi2007-09-023-8/+8 * 2007-08-19 www/emacs-w3m-emacs20: emacs20 and related ports are obsolete; ple...miwi2007-08-1915-2416/+0 * - bsd.qt.mk:lofi2007-08-032-7/+3 * Update to the autotools new world order.ade2007-07-282-8/+7 * Start the deorbit burn of ports that are multilingual versions of emacs19linimon2007-07-191-0/+3 * Start the deorbit burn of emacs19 and dependent files. They are antiquated.linimon2007-07-191-0/+3 * Update to Qt 4.3.0, introduce bsd.qt.mk.lofi2007-07-162-18/+8 * - Change maintainer addressbeech2007-07-051-3/+3 * Update to KDE 3.5.7 / KOffice 1.6.3lofi2007-07-044-8/+6 * Chase the addition of kld category to some missing portsedwin2007-06-301-1/+1 * Add new .mo file (pa translation).cjh2007-06-271-0/+1 * Update to 0.3.1. It depends ko-libhangul now.cjh2007-06-242-5/+7 * make it use termios instead of sgtty.cjh2007-06-122-1/+13 * Korean and foreign language Dictionaries for StarDict.miwi2007-06-054-0/+89 * Remove expired ports:gabor2007-06-0419-652/+0 * merge two patches from irc/bitchx and disable plugins to fix build on CURRENTarved2007-05-304-18/+24 * - Welcome X.org 7.2 \o/.flz2007-05-20