diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-10-19 03:20:44 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-10-19 03:20:44 +0800 |
commit | f7d9f635db0b3375f31bfa8d7984032dad87c5d1 (patch) | |
tree | 225cf401b5f7d01089aa2cbb797fd8bbd2a8fae7 /addressbook | |
parent | c1f6ac725583ac7378896aad9422b4716bcfbbd3 (diff) | |
download | gsoc2013-evolution-f7d9f635db0b3375f31bfa8d7984032dad87c5d1.tar.gz gsoc2013-evolution-f7d9f635db0b3375f31bfa8d7984032dad87c5d1.tar.zst gsoc2013-evolution-f7d9f635db0b3375f31bfa8d7984032dad87c5d1.zip |
Added. Check if our book is local or networked.
2001-10-18 Jon Trowbridge <trow@ximian.com>
* gui/component/select-names/e-select-names-completion.c
(check_capabilities): Added. Check if our book is local or
networked.
(e_select_names_completion_book_ready): Call check_capabilities.
(e_select_names_completion_new): Call check_capabilities.
(e_select_names_completion_do_query): If we have a networked book,
keep trying if we haven't been able to cache any cards --- our
earlier attempts could have failed due to too many matches. (Bug
#12932)
svn path=/trunk/; revision=13762
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 10 | ||||
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names-completion.c | 15 |
2 files changed, 25 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 35c3c7bbac..1fdb0dd408 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,15 @@ 2001-10-18 Jon Trowbridge <trow@ximian.com> + * gui/component/select-names/e-select-names-completion.c + (check_capabilities): Added. Check if our book is local or + networked. + (e_select_names_completion_book_ready): Call check_capabilities. + (e_select_names_completion_new): Call check_capabilities. + (e_select_names_completion_do_query): If we have a networked book, + keep trying if we haven't been able to cache any cards --- our + earlier attempts could have failed due to too many matches. (Bug + #12932) + * gui/component/select-names/e-select-names-manager.c (focus_out_cb): Lag our cardification on focus-out. This seems to help with the unintended cardifications that can result from the 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 7f4a89af54..403173caa8 100644 --- a/addressbook/gui/component/select-names/e-select-names-completion.c +++ b/addressbook/gui/component/select-names/e-select-names-completion.c @@ -65,6 +65,8 @@ struct _ESelectNamesCompletionPrivate { gboolean match_contact_lists; gboolean primary_only; + + gboolean can_fail_due_to_too_many_hits; /* like LDAP, for example... */ }; static void e_select_names_completion_class_init (ESelectNamesCompletionClass *); @@ -967,6 +969,7 @@ e_select_names_completion_do_query (ESelectNamesCompletion *comp, const gchar *q fprintf (out, "cached: %s\n", comp->priv->cached_query_text); can_reuse_cached_cards = (comp->priv->cached_query_text + && (!comp->priv->can_fail_due_to_too_many_hits || comp->priv->cached_cards != NULL) && (strlen (comp->priv->cached_query_text) <= strlen (clean)) && !g_utf8_strncasecmp (comp->priv->cached_query_text, clean, strlen (comp->priv->cached_query_text))); @@ -1111,6 +1114,14 @@ e_select_names_completion_cancel (ECompletion *comp) } static void +check_capabilities (ESelectNamesCompletion *comp, EBook *book) +{ + gchar *cap = e_book_get_static_capabilities (book); + comp->priv->can_fail_due_to_too_many_hits = !strcmp (cap, "net"); + g_free (cap); +} + +static void e_select_names_completion_book_ready (EBook *book, EBookStatus status, ESelectNamesCompletion *comp) { comp->priv->book_ready = TRUE; @@ -1118,6 +1129,8 @@ e_select_names_completion_book_ready (EBook *book, EBookStatus status, ESelectNa g_return_if_fail (E_IS_BOOK (book)); g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp)); + check_capabilities (comp, book); + /* If waiting_query is non-NULL, someone tried to start a query before the book was ready. Now that it is, get started. */ if (comp->priv->waiting_query) { @@ -1163,6 +1176,8 @@ e_select_names_completion_new (EBook *book, ESelectNamesModel *model) gtk_object_ref (GTK_OBJECT (comp->priv->book)); comp->priv->book_ready = TRUE; + check_capabilities (comp, book); + } comp->priv->model = model; |