aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-03-10 09:47:02 +0800
committerChris Toshok <toshok@src.gnome.org>2002-03-10 09:47:02 +0800
commitb6d54c7762636036e6b9173ef8c40befd5ddd1d8 (patch)
treec6ea642ac28cced94ef416bef891819222c65f16
parentc807f01f8f9f8ec9df6461aad78b1247dd4cc1ce (diff)
downloadgsoc2013-evolution-b6d54c7762636036e6b9173ef8c40befd5ddd1d8.tar.gz
gsoc2013-evolution-b6d54c7762636036e6b9173ef8c40befd5ddd1d8.tar.zst
gsoc2013-evolution-b6d54c7762636036e6b9173ef8c40befd5ddd1d8.zip
since I've gone ahead and made the file backend (by way of
2002-03-09 Chris Toshok <toshok@ximian.com> * gui/widgets/e-addressbook-view.c (jump_to_letter): since I've gone ahead and made the file backend (by way of pas-backend-card-sexp.c) use case insensitive searches for beginswith, there's no need to list upper and lower case here. * gui/component/addressbook.c (addressbook_search_option_items): reorder things to put "Any field contains" at the end, since it's the least efficient search. Also reorder the enum to the same ordering. Change "Name contains" to "Name begins with" and change "Email contains" to "Email is". (addressbook_search_activated): change FULL_NAME to beginswith, and change EMAIL to is to match the labels. * backend/pas/pas-backend-card-sexp.c (compare_name): new function, so we can compare both full and family names (so beginswith can operate on them both.) (endswith_helper): use e_utf8_strstrcase here, since all the backends backends use case insensitive searching. (func_endswith): same. svn path=/trunk/; revision=16004
-rw-r--r--addressbook/ChangeLog24
-rw-r--r--addressbook/backend/pas/pas-backend-card-sexp.c23
-rw-r--r--addressbook/gui/component/addressbook.c12
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c16
4 files changed, 53 insertions, 22 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 310d5add60..ab1eb8eb3d 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,4 +1,26 @@
-2002-03-07 Chris Toshok <toshok@ximian.com>
+2002-03-09 Chris Toshok <toshok@ximian.com>
+
+ * gui/widgets/e-addressbook-view.c (jump_to_letter): since I've
+ gone ahead and made the file backend (by way of
+ pas-backend-card-sexp.c) use case insensitive searches for
+ beginswith, there's no need to list upper and lower case here.
+
+ * gui/component/addressbook.c (addressbook_search_option_items):
+ reorder things to put "Any field contains" at the end, since it's
+ the least efficient search. Also reorder the enum to the same
+ ordering. Change "Name contains" to "Name begins with" and change
+ "Email contains" to "Email is".
+ (addressbook_search_activated): change FULL_NAME to beginswith,
+ and change EMAIL to is to match the labels.
+
+ * backend/pas/pas-backend-card-sexp.c (compare_name): new
+ function, so we can compare both full and family names (so
+ beginswith can operate on them both.)
+ (endswith_helper): use e_utf8_strstrcase here, since all the
+ backends backends use case insensitive searching.
+ (func_endswith): same.
+
+2002-03-06 Chris Toshok <toshok@ximian.com>
* backend/pas/pas-book.c (pas_book_queue_create_card): track
union/struct change.
diff --git a/addressbook/backend/pas/pas-backend-card-sexp.c b/addressbook/backend/pas/pas-backend-card-sexp.c
index 8b531d5ede..ea217fa052 100644
--- a/addressbook/backend/pas/pas-backend-card-sexp.c
+++ b/addressbook/backend/pas/pas-backend-card-sexp.c
@@ -71,6 +71,23 @@ compare_phone (ECardSimple *card, const char *str,
}
static gboolean
+compare_name (ECardSimple *card, const char *str,
+ char *(*compare)(const char*, const char*))
+{
+ const char *name;
+
+ name = e_card_simple_get_const (card, E_CARD_SIMPLE_FIELD_FULL_NAME);
+ if (name && compare (name, str))
+ return TRUE;
+
+ name = e_card_simple_get_const (card, E_CARD_SIMPLE_FIELD_FAMILY_NAME);
+ if (name && compare (name, str))
+ return TRUE;
+
+ return FALSE;
+}
+
+static gboolean
compare_address (ECardSimple *card, const char *str,
char *(*compare)(const char*, const char*))
{
@@ -157,7 +174,7 @@ static struct prop_info {
/* query prop, ecard prop, type, list compare function */
NORMAL_PROP ( E_CARD_SIMPLE_FIELD_FILE_AS, "file_as", "file_as" ),
- NORMAL_PROP ( E_CARD_SIMPLE_FIELD_FULL_NAME, "full_name", "full_name" ),
+ LIST_PROP ( "full_name", "full_name", compare_name), /* not really a list, but we need to compare both full and surname */
NORMAL_PROP ( E_CARD_SIMPLE_FIELD_URL, "url", "url" ),
NORMAL_PROP ( E_CARD_SIMPLE_FIELD_MAILER, "mailer", "mailer"),
NORMAL_PROP ( E_CARD_SIMPLE_FIELD_ORG, "org", "org"),
@@ -280,7 +297,7 @@ static char *
endswith_helper (const char *s1, const char *s2)
{
char *p;
- if ((p = strstr(s1, s2))
+ if ((p = (char*)e_utf8_strstrcase(s1, s2))
&& (strlen(p) == strlen(s2)))
return p;
else
@@ -299,7 +316,7 @@ static char *
beginswith_helper (const char *s1, const char *s2)
{
char *p;
- if ((p = strstr(s1, s2))
+ if ((p = (char*)e_utf8_strstrcase(s1, s2))
&& (p == s1))
return p;
else
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 73cb71abff..72cf16cdeb 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -825,18 +825,18 @@ static ESearchBarItem addressbook_search_menu_items[] = {
};
enum {
- ESB_ANY,
ESB_FULL_NAME,
ESB_EMAIL,
ESB_CATEGORY,
+ ESB_ANY,
ESB_ADVANCED
};
static ESearchBarItem addressbook_search_option_items[] = {
- { N_("Any field contains"), ESB_ANY, NULL },
- { N_("Name contains"), ESB_FULL_NAME, NULL },
- { N_("Email contains"), ESB_EMAIL, NULL },
+ { N_("Name begins with"), ESB_FULL_NAME, NULL },
+ { N_("Email is"), ESB_EMAIL, NULL },
{ N_("Category is"), ESB_CATEGORY, NULL }, /* We attach subitems below */
+ { N_("Any field contains"), ESB_ANY, NULL },
{ N_("Advanced..."), ESB_ADVANCED, NULL },
{ NULL, -1, NULL }
};
@@ -898,11 +898,11 @@ addressbook_search_activated (ESearchBar *esb, AddressbookView *view)
s->str);
break;
case ESB_FULL_NAME:
- search_query = g_strdup_printf ("(contains \"full_name\" %s)",
+ search_query = g_strdup_printf ("(beginswith \"full_name\" %s)",
s->str);
break;
case ESB_EMAIL:
- search_query = g_strdup_printf ("(contains \"email\" %s)",
+ search_query = g_strdup_printf ("(is \"email\" %s)",
s->str);
break;
case ESB_CATEGORY:
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 1679c95392..6a78cf13eb 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -649,25 +649,17 @@ jump_to_letter(EAddressbookView *view, gunichar letter)
g_assert (letter_v != NULL && letter_v[0] != NULL);
gstr = g_string_new ("(not (or ");
for (p = letter_v + 1; *p != NULL; p++) {
- char s[7];
-
g_string_sprintfa (gstr, "(beginswith \"file_as\" \"%s\")", *p);
- s[g_unichar_to_utf8 (g_unichar_toupper (g_utf8_get_char (*p)), s)] = '\0';
- g_string_sprintfa (gstr, "(beginswith \"file_as\" \"%s\")", s);
}
g_string_append (gstr, "))");
query = gstr->str;
g_strfreev (letter_v);
g_string_free (gstr, FALSE);
} else {
- char s1[6 + 1], s2[6 + 1];
-
- s1 [g_unichar_to_utf8 (letter, s1)] = '\0';
- s2 [g_unichar_to_utf8 (g_unichar_toupper (letter), s2)] = '\0';
- query = g_strdup_printf ("(or "
- "(beginswith \"file_as\" \"%s\")"
- "(beginswith \"file_as\" \"%s\")"
- ")", s1, s2);
+ char s[6 + 1];
+
+ s [g_unichar_to_utf8 (letter, s)] = '\0';
+ query = g_strdup_printf ("(beginswith \"file_as\" \"%s\")", s);
}
gtk_object_set (GTK_OBJECT (view),
"query", query,
8&id=7541282bbc857e3b52c8cedd620c9cfdf1f29f6c'>- DISTNAME= ${PORTNAME}-${PORTVERSION} is the default and not needed.pgollucci2010-12-301-1/+0 * - Update to 1.4.1pgollucci2010-12-273-149/+143 * - Use canonical format for FreeBSD.org MAINTAINER addressessunpoet2010-12-262-2/+1 * - Update to 2.18wen2010-12-232-3/+3 * - Update to 0.34wen2010-12-232-3/+3 * - Fix fetchwen2010-12-212-2/+3 * - Update to 0.33wen2010-12-163-4/+4 * - Update to 0.32pgollucci2010-12-133-3/+11 * - fix fetch: wget is not required for fetchingpgollucci2010-12-122-6/+0 * Sync to new bsd.autotools.mkade2010-12-045-5/+5 * - Update to 0.4.1wen2010-12-022-4/+3 * Improve port description.danfe2010-11-291-7/+15 * - Also remove them from pkg-plist lists not from me that crept inpgollucci2010-11-241-1/+0 * - Update to 0.31wen2010-11-223-3/+7 * - Update to 2.1wen2010-11-222-4/+3 * - Update to 0.30wen2010-11-172-75/+76 * Fix plist.skreuzer2010-11-171-1/+1 * - Update to 2.15wen2010-11-163-196/+201 * - Update to 1.5.0wen2010-11-103-4/+41 * - Update to 0.28jadawin2010-11-093-7/+3 * - Unbreak build: CPP is now part of MAKE_ENVpav2010-11-081-1/+1 * - Update to 2.10wen2010-11-042-7/+6 * - Unbreak by removing some old and adding some new master sitesrene2010-10-311-5/+4 * - Update to 0.4.0wen2010-10-262-4/+4 * - Update to 0.26wen2010-10-253-5/+8 * - Update to 0.22wen2010-10-223-20/+20 * Update my MAINTAINER address to culot@FreeBSD.org.culot2010-10-201-1/+1 * - Update to 2.14wen2010-10-192-4/+4 * Punt autoconf267->autoconf268ade2010-10-161-1/+1 * - Update to 4.2.0wen2010-10-083-5/+6 * Round one migration of ports from automake{19,110} to automake111ade2010-10-062-2/+2 * - Add an additional MASTER_SITESsunpoet2010-10-011-1/+2 * Mark BROKEN: does not fetch.erwin2010-09-301-0/+1 * - Update to 2.13wen2010-09-263-4/+5 * - Update to 0.76wen2010-09-252-4/+4 * Change dependency on old p5-Compress-Zlib, p5-IO-Compress-Base,mm2010-09-211-1/+2 * Also broken on sparc64 (and, by implication, ia64).linimon2010-09-171-2/+2 * Update to 1.3r1.3913.maho2010-09-174-636/+699 * - Update to 4.1.0wen2010-09-163-5/+28 * Autotools update. Read ports/UPDATING 20100915 for details.ade2010-09-161-1/+2 * - Update to 4.4cwen2010-09-082-4/+4 * - Update to 0.75wen2010-09-073-6/+12 * - Update to 1.13wen2010-09-072-4/+4 * - Update MAINTAINER to submitters new mail addressdecke2010-09-041-1/+1 * - Update to 2.10.0sahil2010-08-215-29/+13 * - Update USE_PYTHON in Makefile to reflect upstream Pythonglarkin2010-08-181-1/+1 * Update to 1.12:az2010-08-182-5/+5 * - Update to 2.1.5lwhsu2010-08-042-7/+12 * Fix typo in maintainer mail addressbapt2010-08-031-1/+1 * - Update to 1.12.4bapt2010-08-022-6/+11 * - Update the libmap instructions for amd64/8pav2010-07-292-4/+14 * - Update to 1.54wen2010-07-023-49/+146 * - Update to 2.11wen2010-06-302-4/+4 * - Update to 1.17wen2010-06-302-4/+4 * - Update to 1.16wen2010-06-242-4/+4 * - Update to 2.04wen2010-06-223-7/+6 * BROKEN should not be quoted.erwin2010-06-131-1/+1 * - Update to 1.15wen2010-06-122-5/+4 * Update to 1.10.tobez2010-06-112-7/+6 * - Update to 1.4.0pgollucci2010-06-083-75/+188 * LICENSE GPLv2dinoex2010-06-062-1/+3 * LICENSE LGPL21dinoex2010-06-051-0/+2 * - Update to 1.4.1wen2010-06-013-4/+25 * Bounce PORTREVISION for gettext-related ports. Have fun, ya'll.ade2010-05-311-1/+1 * - Update to 3.1.6sylvio2010-05-313-5/+5 * - drop USE_GNUSTEP_PREFIXdinoex2010-05-304-320/+318 * - Update to 4.0.1wen2010-05-242-4/+4 * - fix build for gnustep-base 1.21.0dinoex2010-05-241-2/+3 * - Update to 1.12.2wen2010-05-213-6/+7 * - Update to 2.09wen2010-05-182-4/+4 * - Update to 2.0.8wen2010-05-143-5/+4 * - Update to 2.0.7wen2010-05-102-5/+5 * - Update to 3.1.4sylvio2010-05-093-11/+18 * - Update to 1.00wen2010-05-082-5/+6 * - Removed BROKEN because file fetches and checksums correctlyglarkin2010-04-291-3/+2 * - Update to 2.04wen2010-04-202-4/+5 * - Update to 4.4awen2010-04-202-7/+7 * - update to 0.81dinoex2010-04-143-10/+32 * - Update to 6.2.0wen2010-04-076-75/+232 * - Update to 2.03wen2010-04-022-4/+4 * Mark various ports as broken or ignore on powerpc.linimon2010-04-013-3/+21 * - Update to 2.02wen2010-03-303-5/+6 * - Bump PORTREVISION to chase the update of math/gslwen2010-03-291-2/+2 * - update to 1.4.1dinoex2010-03-2818-20/+22 * - Update to 3.1.3wen2010-03-242-5/+5 * - Chase x11-toolkits/fltk updategahr2010-03-242-5/+5 * - Update to 3.22sylvio2010-03-222-4/+4 * - Update to 0.3.9wen2010-03-192-4/+4 * - Update to 2.01wen2010-03-102-4/+4 * - Update to 0.21wen2010-03-093-47/+41 * - Update to 0.18wen2010-03-033-35/+72 * p5-Bio-Das-Lite is an implementation of a client for the DAS protocol (XMLwen2010-03-015-0/+42 * - Update to 0.7wen2010-02-243-9/+8 * - Reset more ports I don't use anymorepgollucci2010-02-111-1/+1 * Update to 3.1.2edwin2010-02-102-4/+4 * - Update to 2.00wen2010-02-103-5/+5 * - update to jpeg-8dinoex2010-02-0518-18/+19 * - Update to 0.99wen2010-02-032-5/+5 * - Update to 3.1.1miwi2010-02-035-88/+40 * - use $SUB_FILES to dynamically adjust pkg-messagepgollucci2010-01-311-2/+1 * - Remove unneeded dependencies which is in perl-5.8.9 distkuriyama2010-01-294-11/+7 * - actually remove old patchpgollucci2010-01-171-31/+0 * - Fix on amd64pgollucci2010-01-174-0/+60 * - Remove unneeded dependencies which is in perl-5.8.9 dist from portskuriyama2010-01-161-2/+2 * - SUB_FILES += pkg-messagepgollucci2010-01-101-4/+1 * - Update to 1.03wen2010-01-092-5/+5 * - SBU_FILES += pkg-messagepgollucci2010-01-084-56/+54 * - Update to 1.995wen2010-01-072-4/+4 * - Update to 1.53wen2010-01-063-99/+39 * python-nexus is a generic nexus (phylogenetics) file format(.nex, .trees)wen2009-12-295-0/+35 * - Fix fetch errorwen2009-12-271-2/+2 * - Update to 0.3.7wen2009-12-242-4/+4 * - Update to 7.1.11miwi2009-12-224-41/+49 * - Update to 0.3.5wen2009-12-212-4/+4 * For ports maintained by ports@FreeBSD.org, remove names and/ordougb2009-12-2111-22/+0 * - Update to 1.1.4wen2009-12-182-11/+11 * - Update to 1.4wen2009-12-173-30/+126 * - Update to 0.3.4wen2009-12-162-4/+4 * - Turn over a bunch of p5- ports that change infrequently to perl@pgollucci2009-12-141-1/+1 * - Update to 1.994wen2009-12-113-4/+6 * - Update to 0.3.3wen2009-12-063-7/+7 * - Update to 1.993wen2009-12-042-4/+4 * - Update to 1.6.1wen2009-12-045-912/+939 * Chase math/gsl update,makc2009-12-021-2/+2 * - Update to 2.0.12wen2009-11-292-6/+5 * - Update my mail address to FreeBSDsylvio2009-11-281-1/+1 * - Mark MAKE_JOBS_UNSAFEpav2009-11-212-0/+2 * - Update to 1.992wen2009-11-202-5/+5 * - broken checksum mismatchmiwi2009-11-191-0/+2 * - Mark MAKE_JOBS_UNSAFEpav2009-11-191-0/+1 * pyfasta is a python module for fast, memory-efficient, pythonicwen2009-11-185-0/+52 * - Update to 21.1.1wen2009-11-184-29/+17 * Velvet is a de novo genomic assembler specially designed for short readamdmi32009-11-077-0/+244 * - Annotate that 8.x no longer needs libmap hackpav2009-10-011-1/+1 * - Update to 4.0.0wen2009-09-234-13/+23 * Update to Crux 1.2.0.jasone2009-09-203-26/+29 * UNBREAK: Probably was a temporary failure, checksums are ok now.garga2009-09-161-2/+0 * -Update to 3.69miwi2009-09-162-14/+10 * Bump PORTREVISION for everything that sets USE_FORTRAN=yes which nowgerald2009-09-136-5/+6 * - Update to 1.14jadawin2009-09-082-4/+4 * - Update to 138038miwi2009-09-054-444/+152 * - Update to 0.982miwi2009-08-292-5/+5 * Bio::SCF module allows you to read and update (in a restrictedmiwi2009-08-295-0/+46 * Io_lib is a library of file reading and writing code to provide amiwi2009-08-295-0/+107 * - Update to 3.21.araujo2009-08-282-5/+5 * - Update to 1.12miwi2009-08-282-5/+4 * Update to 35.4.9makc2009-08-232-4/+4 * Bio::NEXUS package provides an object-oriented, Perl-basedmiwi2009-08-235-0/+91 * - BROKEN checksum mismatchmiwi2009-08-221-0/+2 * - Switch SourceForge ports to the new File Release System: categories startin...amdmi32009-08-225-8/+5 * - Fix fetchmiwi2009-08-171-1/+1 * - Update MASTER_SITESmiwi2009-08-142-4/+2 * - Update to 4.3miwi2009-08-142-6/+6 * Fix PKGORIGINerwin2009-08-081-1/+1 * - Relax check on bioperl version; people keep forgetting to update this checkpav2009-08-031-1/+1 * - Unbreak fetchpav2009-08-031-1/+1 * -Repocopy devel/libtool15 -> libtool22 and libltdl15 -> libltdl22.mezz2009-08-032-2/+2 * - bump all port that indirectly depends on libjpeg and have not yet been bump...dinoex2009-07-3114-7/+14 * Utilize %%SITE_PERL%% and %%PERL_ARCH%% in pkg-plistspgollucci2009-07-311-3/+3 * - lang/perl5.6 is dead, remove PERL_LEVEL/PERL_VERSION < 500801 checkspgollucci2009-07-232-14/+1 * PhyML is a software that estimates maximum likelihood phylogenies fromamdmi32009-07-216-0/+75 * - update to jpeg7dinoex2009-07-18