aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-08 10:27:41 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-08 10:27:41 +0800
commit84463baa0dfa28cfddb7ea6b37126e172e058784 (patch)
treef8f5db44e58bf474ea22de644aada6a3694f6680
parent3d4f29c7c78f5df88c6f4de8a02c87fb299d4482 (diff)
downloadgsoc2013-evolution-84463baa0dfa28cfddb7ea6b37126e172e058784.tar
gsoc2013-evolution-84463baa0dfa28cfddb7ea6b37126e172e058784.tar.gz
gsoc2013-evolution-84463baa0dfa28cfddb7ea6b37126e172e058784.tar.bz2
gsoc2013-evolution-84463baa0dfa28cfddb7ea6b37126e172e058784.tar.lz
gsoc2013-evolution-84463baa0dfa28cfddb7ea6b37126e172e058784.tar.xz
gsoc2013-evolution-84463baa0dfa28cfddb7ea6b37126e172e058784.tar.zst
gsoc2013-evolution-84463baa0dfa28cfddb7ea6b37126e172e058784.zip
tests are linking now, and link in libcamel.la.
2002-11-07 Chris Toshok <toshok@ximian.com> * backend/ebook/Makefile.am: tests are linking now, and link in libcamel.la. * backend/ebook/e-destination.c (e_destination_get_name): un-ifdef since camel is compiling. (e_destination_get_email): same. (e_destination_get_address): same. (e_destination_get_textrep): same. * backend/ebook/e-card-compare.c (name_fragment_match): use e_utf8_casefold_*. (name_fragment_match_with_synonyms): same. (e_card_compare_name_to_string_full): same. (e_card_compare_name): same. svn path=/trunk/; revision=18655
-rw-r--r--addressbook/ChangeLog16
-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
4 files changed, 56 insertions, 77 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 445ffcb63c..c1b34717ef 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,21 @@
2002-11-07 Chris Toshok <toshok@ximian.com>
+ * backend/ebook/Makefile.am: tests are linking now, and link in
+ libcamel.la.
+
+ * backend/ebook/e-destination.c (e_destination_get_name): un-ifdef
+ since camel is compiling.
+ (e_destination_get_email): same.
+ (e_destination_get_address): same.
+ (e_destination_get_textrep): same.
+
+ * backend/ebook/e-card-compare.c (name_fragment_match): use e_utf8_casefold_*.
+ (name_fragment_match_with_synonyms): same.
+ (e_card_compare_name_to_string_full): same.
+ (e_card_compare_name): same.
+
+2002-11-07 Chris Toshok <toshok@ximian.com>
+
* backend/ebook/e-book-util.h: add prototypes for e_utf8_casefold_collate{_len}
* backend/ebook/e-book-util.c (e_utf8_casefold_collate_len): move
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