aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas/pas-backend-file.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-03-16 16:16:29 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-03-16 16:16:29 +0800
commit57de6972c845dbae49717a4520aeed75f88f0078 (patch)
treef58e45cdbb09793d8a09506af00c70b1ca63a389 /addressbook/backend/pas/pas-backend-file.c
parent403205b15e9f14472711ee115cae17031eb4ce7b (diff)
downloadgsoc2013-evolution-57de6972c845dbae49717a4520aeed75f88f0078.tar
gsoc2013-evolution-57de6972c845dbae49717a4520aeed75f88f0078.tar.gz
gsoc2013-evolution-57de6972c845dbae49717a4520aeed75f88f0078.tar.bz2
gsoc2013-evolution-57de6972c845dbae49717a4520aeed75f88f0078.tar.lz
gsoc2013-evolution-57de6972c845dbae49717a4520aeed75f88f0078.tar.xz
gsoc2013-evolution-57de6972c845dbae49717a4520aeed75f88f0078.tar.zst
gsoc2013-evolution-57de6972c845dbae49717a4520aeed75f88f0078.zip
Added addressbook querying and "cardification" functions, which are turned
2001-03-15 Jon Trowbridge <trow@ximian.com> * gui/component/e-address-widget.c: Added addressbook querying and "cardification" functions, which are turned off by default for now because of addressbook bugs. Added a popup menu option to turn queries on, so that others can enjoy the thrill of massive flaming death. * gui/component/addressbook-factory.c (main): Made warnings always be fatal. * backend/pas/pas-book-view.c: Added some debugging spew. * backend/pas/pas-backend-file.c (pas_backend_file_search): Added a little experimental code to try to make file searches scale better. #if 0/#endif-ed out for now. * contact-editor/e-contact-quick-add.c: #included e-book-util.h. * backend/ebook/e-card.c (e_card_name_match_string): Added. Looser name-matching function. (e_card_email_match_string): Added. Loose e-mail matching. * backend/ebook/e-book-view-listener.c (e_book_view_listener_check_queue): Added code to cause us to abort rather than get trapped in a 100%-CPU-consuming loop in certain situations. Now we just need to figure out how to avoid these situations altogether. * backend/ebook/e-book-util.c: Added. Now contains the simple query stuff and the open local addressbook functions. * backend/ebook/e-book.c: Moved simple query stuff and open local addressbook functions into e-book-util.c. 2001-03-15 Jon Trowbridge <trow@ximian.com> * wombat.c (main): If we can't initialize a service on startup, tell us which one before terminating. svn path=/trunk/; revision=8754
Diffstat (limited to 'addressbook/backend/pas/pas-backend-file.c')
-rw-r--r--addressbook/backend/pas/pas-backend-file.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index 88e78382e5..74b8613d3d 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -475,6 +475,7 @@ pas_backend_file_search (PASBackendFile *bf,
{
int db_error = 0;
GList *cards = NULL;
+ gint card_count = 0;
DB *db = bf->priv->file_db;
DBT id_dbt, vcard_dbt;
int i;
@@ -518,6 +519,18 @@ pas_backend_file_search (PASBackendFile *bf,
/* check if the vcard matches the search sexp */
if (vcard_matches_search (view, vcard_string)) {
cards = g_list_append (cards, g_strdup (vcard_string));
+ ++card_count;
+#if 0
+ /* If we've accumulated a number of matches, pass them off to the client. */
+ if (card_count > 50) {
+ pas_book_view_notify_add (view->book_view, cards);
+ /* Clean up the handed-off data. */
+ g_list_foreach (cards, (GFunc)g_free, NULL);
+ g_list_free (cards);
+ cards = NULL;
+ card_count = 0;
+ }
+#endif
}
}
@@ -528,7 +541,9 @@ pas_backend_file_search (PASBackendFile *bf,
g_warning ("pas_backend_file_search: error building list\n");
}
- pas_book_view_notify_add (view->book_view, cards);
+ // if (card_count)
+ pas_book_view_notify_add (view->book_view, cards);
+
pas_book_view_notify_complete (view->book_view);
/*