aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/Makefile.am61
-rw-r--r--addressbook/backend/ebook/e-card-compare.c35
-rw-r--r--addressbook/backend/ebook/e-destination.c21
3 files changed, 40 insertions, 77 deletions
diff --git a/addressbook/backend/ebook/Makefile.am b/addressbook/backend/ebook/Makefile.am
index 720c1273a1..c72ba64342 100644
--- a/addressbook/backend/ebook/Makefile.am
+++ b/addressbook/backend/ebook/Makefile.am
@@ -91,35 +91,38 @@ e-book-marshal.c: e-book-marshal.h
MARSHAL_GENERATED = e-book-marshal.c e-book-marshal.h
-# test_client_SOURCES = \
-# test-client.c
-
-# test_client_LDADD = \
-# libebook.la \
-# $(EVOLUTION_ADDRESSBOOK_LIBS) \
-# $(top_builddir)/libversit/libversit.a \
-# $(top_builddir)/e-util/ename/libename.la \
-# $(top_builddir)/e-util/libeutil.la
-
-# test_client_list_SOURCES = \
-# test-client-list.c
-
-# test_client_list_LDADD = \
-# libebook.la \
-# $(EVOLUTION_ADDRESSBOOK_LIBS) \
-# $(top_builddir)/e-util/ename/libename.la \
-# $(top_builddir)/libversit/libversit.a \
-# $(top_builddir)/e-util/libeutil.la
-
-# test_card_SOURCES = \
-# test-card.c
-
-# test_card_LDADD = \
-# libebook.la \
-# $(EVOLUTION_ADDRESSBOOK_LIBS) \
-# $(top_builddir)/e-util/ename/libename.la \
-# $(top_builddir)/libversit/libversit.a \
-# $(top_builddir)/e-util/libeutil.la
+test_client_SOURCES = \
+ test-client.c
+
+test_client_LDADD = \
+ libebook.la \
+ $(EVOLUTION_ADDRESSBOOK_LIBS) \
+ $(top_builddir)/camel/libcamel.la \
+ $(top_builddir)/libversit/libversit.a \
+ $(top_builddir)/e-util/ename/libename.la \
+ $(top_builddir)/e-util/libeutil.la
+
+test_client_list_SOURCES = \
+ test-client-list.c
+
+test_client_list_LDADD = \
+ libebook.la \
+ $(EVOLUTION_ADDRESSBOOK_LIBS) \
+ $(top_builddir)/camel/libcamel.la \
+ $(top_builddir)/e-util/ename/libename.la \
+ $(top_builddir)/libversit/libversit.a \
+ $(top_builddir)/e-util/libeutil.la
+
+test_card_SOURCES = \
+ test-card.c
+
+test_card_LDADD = \
+ libebook.la \
+ $(EVOLUTION_ADDRESSBOOK_LIBS) \
+ $(top_builddir)/camel/libcamel.la \
+ $(top_builddir)/e-util/ename/libename.la \
+ $(top_builddir)/libversit/libversit.a \
+ $(top_builddir)/e-util/libeutil.la
# evolution_vcard_importer_SOURCES = \
# evolution-vcard-importer.c
diff --git a/addressbook/backend/ebook/e-card-compare.c b/addressbook/backend/ebook/e-card-compare.c
index 7b6c6f0823..1593bd022d 100644
--- a/addressbook/backend/ebook/e-card-compare.c
+++ b/addressbook/backend/ebook/e-card-compare.c
@@ -80,27 +80,6 @@ static gchar *name_synonyms[][2] = {
{ NULL, NULL }
};
-static int
-utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len)
-{
- gchar *s1 = g_utf8_casefold(str1, len);
- gchar *s2 = g_utf8_casefold(str2, len);
- int rv;
-
- rv = g_utf8_collate (s1, s2);
-
- g_free (s1);
- g_free (s2);
-
- return rv;
-}
-
-static int
-utf8_casefold_collate (const gchar *str1, const gchar *str2)
-{
- return utf8_casefold_collate_len (str1, str2, -1);
-}
-
static gboolean
name_fragment_match (const gchar *a, const gchar *b, gboolean strict)
{
@@ -122,7 +101,7 @@ name_fragment_match (const gchar *a, const gchar *b, gboolean strict)
len = MIN (g_utf8_strlen (a, -1), g_utf8_strlen (b, -1));
}
- return !utf8_casefold_collate_len (a, b, len);
+ return !e_utf8_casefold_collate_len (a, b, len);
}
static gboolean
@@ -139,12 +118,12 @@ name_fragment_match_with_synonyms (const gchar *a, const gchar *b, gboolean stri
/* Check for nicknames. Yes, the linear search blows. */
for (i=0; name_synonyms[i][0]; ++i) {
- if (!utf8_casefold_collate (name_synonyms[i][0], a)
- && !utf8_casefold_collate (name_synonyms[i][1], b))
+ if (!e_utf8_casefold_collate (name_synonyms[i][0], a)
+ && !e_utf8_casefold_collate (name_synonyms[i][1], b))
return TRUE;
- if (!utf8_casefold_collate (name_synonyms[i][0], b)
- && !utf8_casefold_collate (name_synonyms[i][1], a))
+ if (!e_utf8_casefold_collate (name_synonyms[i][0], b)
+ && !e_utf8_casefold_collate (name_synonyms[i][1], a))
return TRUE;
}
@@ -241,7 +220,7 @@ e_card_compare_name_to_string_full (ECard *card, const gchar *str, gboolean allo
if (familyv && this_part_match == E_CARD_MATCH_PART_NONE) {
for (j = 0; familyv[j]; ++j) {
if (allow_partial_matches ? name_fragment_match_with_synonyms (familyv[j], namev[i], allow_partial_matches)
- : !utf8_casefold_collate (familyv[j], namev[i])) {
+ : !e_utf8_casefold_collate (familyv[j], namev[i])) {
this_part_match = E_CARD_MATCH_PART_FAMILY_NAME;
@@ -330,7 +309,7 @@ e_card_compare_name (ECard *card1, ECard *card2)
if (a->family && b->family) {
++possible;
/* We don't allow "loose matching" (i.e. John vs. Jon) on family names */
- if (! utf8_casefold_collate (a->family, b->family)) {
+ if (! e_utf8_casefold_collate (a->family, b->family)) {
++matches;
family_match = TRUE;
}
diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c
index 3d5f88acab..6537ea7480 100644
--- a/addressbook/backend/ebook/e-destination.c
+++ b/addressbook/backend/ebook/e-destination.c
@@ -372,7 +372,6 @@ e_destination_is_valid (const EDestination *dest)
gboolean
e_destination_equal (const EDestination *a, const EDestination *b)
{
-#ifdef PENDING_PORT_WORK
const struct _EDestinationPrivate *pa, *pb;
const char *na, *nb;
@@ -399,13 +398,11 @@ e_destination_equal (const EDestination *a, const EDestination *b)
/* Just in case name returns NULL */
na = e_destination_get_name (a);
nb = e_destination_get_name (b);
- if ((na || nb) && !(na && nb && ! g_utf8_strcasecmp (na, nb)))
+ if ((na || nb) && !(na && nb && ! e_utf8_casefold_collate (na, nb)))
return FALSE;
if (!g_strcasecmp (e_destination_get_email (a), e_destination_get_email (b)))
return TRUE;
-#endif
- return FALSE;
}
void
@@ -683,7 +680,6 @@ e_destination_get_email_num (const EDestination *dest)
const gchar *
e_destination_get_name (const EDestination *dest)
{
-#ifdef PENDING_PORT_WORK
struct _EDestinationPrivate *priv;
g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
@@ -721,15 +717,11 @@ e_destination_get_name (const EDestination *dest)
}
return priv->name;
-#else
- return "e_destination_get_name needs port work";
-#endif
}
const gchar *
e_destination_get_email (const EDestination *dest)
{
-#ifdef PENDING_PORT_WORK
struct _EDestinationPrivate *priv;
g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
@@ -774,15 +766,11 @@ e_destination_get_email (const EDestination *dest)
}
return priv->email;
-#else
- return "e_destination_get_email needs port work";
-#endif
}
const gchar *
e_destination_get_address (const EDestination *dest)
{
-#ifdef PENDING_PORT_WORK
struct _EDestinationPrivate *priv;
g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
@@ -824,9 +812,6 @@ e_destination_get_address (const EDestination *dest)
}
return priv->addr;
-#else
- return "e_destination_get_address needs port work";
-#endif
}
void
@@ -849,7 +834,6 @@ e_destination_set_raw (EDestination *dest, const gchar *raw)
const gchar *
e_destination_get_textrep (const EDestination *dest)
{
-#ifdef PENDING_PORT_WORK
const char *name, *email;
g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
@@ -880,9 +864,6 @@ e_destination_get_textrep (const EDestination *dest)
return email;
return "";
-#else
- return "e_destination_get_textrep needs port work";
-#endif
}
gboolean