aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog19
-rw-r--r--addressbook/backend/ebook/e-book.c1
-rw-r--r--addressbook/backend/ebook/e-card.c2
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c10
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c64
5 files changed, 44 insertions, 52 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index ff172698a0..6544bddc37 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,24 @@
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.)
+
+2003-02-09 Chris Toshok <toshok@ximian.com>
+
* gui/component/select-names/e-select-names-completion.c: lots of
changes here. should be a big performance gain. god i hope this
is finally right.
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
index 7cdca25d95..dd7b433ff8 100644
--- a/addressbook/backend/ebook/e-book.c
+++ b/addressbook/backend/ebook/e-book.c
@@ -35,6 +35,7 @@ struct _EBookPrivate {
GList *book_factories;
GList *iter;
+ /* cached capabilites */
char *cap;
gboolean cap_queried;
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 38ee1ce224..70add9591d 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -2106,7 +2106,7 @@ e_card_set_property (GObject *object,
case PROP_CATEGORY_LIST:
if (card->categories)
g_object_unref(card->categories);
- card->categories = E_LIST(g_value_get_pointer(value));
+ card->categories = E_LIST(g_value_get_object(value));
if (card->categories)
g_object_ref(card->categories);
break;
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
index 3e0db0fca5..2c919c788b 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -2614,10 +2614,12 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da
str, str));
}
else if (!strcmp (ldap_attr, "fileAs")) {
- ldap_data->list = g_list_prepend(ldap_data->list,
- g_strdup_printf(
- "(|(fileAs=%s*)(&(!(fileAs=*))(sn=%s*)))",
- str, str));
+ if (ldap_data->bl->priv->evolutionPersonSupported)
+ ldap_data->list = g_list_prepend(ldap_data->list,
+ g_strdup_printf("(fileAs=%s*)", str));
+ else
+ ldap_data->list = g_list_prepend(ldap_data->list,
+ g_strdup_printf("(sn=%s*)", str));
}
else {
ldap_data->list = g_list_prepend(ldap_data->list,
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);
}
}
}