aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/select-names
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-02-10 14:21:12 +0800
committerChris Toshok <toshok@src.gnome.org>2003-02-10 14:21:12 +0800
commit29d288066ba3f8ad75e1737eb82bfdc96b8d6983 (patch)
treecc58689bbe3a17e80d3bd4132d597e1ba3dd8a88 /addressbook/gui/component/select-names
parent0c46add40d66626845b0042f2904389846b0d237 (diff)
downloadgsoc2013-evolution-29d288066ba3f8ad75e1737eb82bfdc96b8d6983.tar.gz
gsoc2013-evolution-29d288066ba3f8ad75e1737eb82bfdc96b8d6983.tar.zst
gsoc2013-evolution-29d288066ba3f8ad75e1737eb82bfdc96b8d6983.zip
gone. (match_initials): gone. (book_query_sexp): remove the primary
2003-02-09 Chris Toshok <toshok@ximian.com> * gui/component/select-names/e-select-names-completion.c (sexp_initials): gone. (match_initials): gone. (book_query_sexp): remove the primary handling. (book_query_score): same. * backend/ebook/e-card.c (e_card_set_property): g_value_get_pointer => g_value_get_object for "category_list". * backend/ebook/e-book.c (struct _EBookPrivate): add a comment. * backend/pas/pas-backend-ldap.c (func_beginswith): performance at the cost of a tiny bit of correctness. If the ldap server doesn't support evolutionPerson don't query on fileAs, use sn (since that's effectively what gets used in the display when fileAs isn't supported.) svn path=/trunk/; revision=19863
Diffstat (limited to 'addressbook/gui/component/select-names')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c64
1 files changed, 17 insertions, 47 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c
index 29ef1febf7..c679b51233 100644
--- a/addressbook/gui/component/select-names/e-select-names-completion.c
+++ b/addressbook/gui/component/select-names/e-select-names-completion.c
@@ -67,7 +67,6 @@ struct _ESelectNamesCompletionPrivate {
gchar *query_text;
gboolean match_contact_lists;
- gboolean primary_only;
gint minimum_query_length;
};
@@ -434,36 +433,17 @@ match_file_as (ESelectNamesCompletion *comp, EDestination *dest)
return match;
}
-/*
- * Initials Query
- */
-
-static gchar *
-sexp_initials (ESelectNamesCompletion *comp)
-{
- return NULL;
-}
-
-static ECompletionMatch *
-match_initials (ESelectNamesCompletion *comp, EDestination *dest)
-{
- return NULL;
-}
-
-
typedef struct _BookQuery BookQuery;
struct _BookQuery {
- gboolean primary;
BookQuerySExp builder;
BookQueryMatchTester tester;
};
static BookQuery book_queries[] = {
- { TRUE, sexp_nickname, match_nickname},
- { TRUE, sexp_email, match_email },
- { TRUE, sexp_name, match_name },
- { TRUE, sexp_file_as, match_file_as },
- { FALSE, sexp_initials, match_initials }
+ { sexp_nickname, match_nickname},
+ { sexp_email, match_email },
+ { sexp_name, match_name },
+ { sexp_file_as, match_file_as },
};
static gint book_query_count = sizeof (book_queries) / sizeof (BookQuery);
@@ -473,7 +453,7 @@ static gint book_query_count = sizeof (book_queries) / sizeof (BookQuery);
static gchar *
book_query_sexp (ESelectNamesCompletion *comp)
{
- gint i, j, count = 0;
+ gint i, j;
gchar **queryv, *query;
g_return_val_if_fail (comp && E_IS_SELECT_NAMES_COMPLETION (comp), NULL);
@@ -481,16 +461,8 @@ book_query_sexp (ESelectNamesCompletion *comp)
if (! (comp->priv->query_text && *comp->priv->query_text))
return NULL;
- if (comp->priv->primary_only) {
- for (i=0; i<book_query_count; ++i)
- if (book_queries[i].primary)
- ++count;
- } else {
- count = book_query_count;
- }
-
- queryv = g_new0 (gchar *, count+1);
- for (i=0, j=0; i<count; ++i) {
+ queryv = g_new0 (gchar *, book_query_count+1);
+ for (i=0, j=0; i<book_query_count; ++i) {
queryv[j] = book_queries[i].builder (comp);
if (queryv[j])
++j;
@@ -507,7 +479,7 @@ book_query_sexp (ESelectNamesCompletion *comp)
g_free (tmp);
}
- for (i=0; i<count; ++i)
+ for (i=0; i<book_query_count; ++i)
g_free (queryv[i]);
g_free (queryv);
@@ -534,18 +506,16 @@ book_query_score (ESelectNamesCompletion *comp, EDestination *dest)
ECompletionMatch *this_match = NULL;
- if (book_queries[i].primary || !comp->priv->primary_only) {
- if (book_queries[i].tester && e_destination_get_card (dest)) {
- this_match = book_queries[i].tester (comp, dest);
- }
+ if (book_queries[i].tester && e_destination_get_card (dest)) {
+ this_match = book_queries[i].tester (comp, dest);
+ }
- if (this_match) {
- if (best_match == NULL || this_match->score > best_match->score) {
- e_completion_match_unref (best_match);
- best_match = this_match;
- } else {
- e_completion_match_unref (this_match);
- }
+ if (this_match) {
+ if (best_match == NULL || this_match->score > best_match->score) {
+ e_completion_match_unref (best_match);
+ best_match = this_match;
+ } else {
+ e_completion_match_unref (this_match);
}
}
}