aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/select-names/e-select-names-completion.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-01-02 05:15:18 +0800
committerChris Toshok <toshok@src.gnome.org>2003-01-02 05:15:18 +0800
commit176ee176678618d647af68036550e9d05a3babab (patch)
treeb696f772293d1d59868217ed33493c8ea87f96fc /addressbook/gui/component/select-names/e-select-names-completion.c
parentb69a32f31aa15a670f90496e8a000c2bfaae802b (diff)
downloadgsoc2013-evolution-176ee176678618d647af68036550e9d05a3babab.tar
gsoc2013-evolution-176ee176678618d647af68036550e9d05a3babab.tar.gz
gsoc2013-evolution-176ee176678618d647af68036550e9d05a3babab.tar.bz2
gsoc2013-evolution-176ee176678618d647af68036550e9d05a3babab.tar.lz
gsoc2013-evolution-176ee176678618d647af68036550e9d05a3babab.tar.xz
gsoc2013-evolution-176ee176678618d647af68036550e9d05a3babab.tar.zst
gsoc2013-evolution-176ee176678618d647af68036550e9d05a3babab.zip
[ fixes the non-ui portion of #36183 ] use the entry's
2003-01-01 Chris Toshok <toshok@ximian.com> [ fixes the non-ui portion of #36183 ] * gui/component/select-names/e-select-names-completion.c (e_select_names_completion_start_query): use the entry's minimum_query_length instead of a constant here. (e_select_names_completion_set_minimum_query_length): new function, set the entry's minimum_query_length. * gui/component/select-names/e-select-names-manager.c (e_select_names_manager_entry_new): set the minimum_query length after setting the completion books. (read_completion_settings_from_db): rename read_completion_books_from_db to this, and read the minimum_query_length too. (db_listener): rename uris_listener to this, and listen for changes on both the uris and minimum_query_length settings. * gui/component/select-names/e-select-names-completion.h: add prototype for e_select_names_completion_set_minimum_query_length. * gui/component/select-names/e-select-names-manager.h: add minimum_query_length to struct _ESelectNamesManager. svn path=/trunk/; revision=19199
Diffstat (limited to 'addressbook/gui/component/select-names/e-select-names-completion.c')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c14
1 files changed, 10 insertions, 4 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 602d6521b0..32d0be9268 100644
--- a/addressbook/gui/component/select-names/e-select-names-completion.c
+++ b/addressbook/gui/component/select-names/e-select-names-completion.c
@@ -39,8 +39,6 @@
#include <addressbook/backend/ebook/e-card-simple.h>
#include <addressbook/backend/ebook/e-card-compare.h>
-#define MINIMUM_QUERY_LENGTH 3
-
typedef struct {
EBook *book;
guint book_view_tag;
@@ -71,6 +69,8 @@ struct _ESelectNamesCompletionPrivate {
gboolean primary_only;
gboolean can_fail_due_to_too_many_hits; /* like LDAP, for example... */
+
+ gint minimum_query_length;
};
static void e_select_names_completion_class_init (ESelectNamesCompletionClass *);
@@ -1022,10 +1022,9 @@ e_select_names_completion_start_query (ESelectNamesCompletion *comp, const gchar
if (comp->priv->books_not_ready == 0) {
gchar *sexp;
- if (strlen (query_text) < MINIMUM_QUERY_LENGTH)
+ if (strlen (query_text) < comp->priv->minimum_query_length)
return;
-
g_free (comp->priv->query_text);
comp->priv->query_text = g_strdup (query_text);
@@ -1317,6 +1316,13 @@ e_select_names_completion_clear_books (ESelectNamesCompletion *comp)
e_select_names_completion_clear_book_data (comp);
}
+void
+e_select_names_completion_set_minimum_query_length (ESelectNamesCompletion *comp, int query_length)
+{
+ g_return_if_fail (E_IS_SELECT_NAMES_COMPLETION (comp));
+ comp->priv->minimum_query_length = query_length;
+}
+
gboolean
e_select_names_completion_get_match_contact_lists (ESelectNamesCompletion *comp)
{