aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas/pas-backend-summary.c
Commit message (Collapse)AuthorAgeFilesLines
* guard against multiple invocations.Chris Toshok2002-11-101-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-11-10 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-card-sexp.c (pas_backend_card_sexp_dispose): guard against multiple invocations. * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): same. * backend/pas/pas-book.c (pas_book_dispose): same. * backend/pas/pas-book-view.c (pas_book_view_dispose): same. * backend/pas/pas-book-factory.c (pas_book_factory_dispose): same. * backend/pas/pas-backend-summary.c (pas_backend_summary_dispose): same. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_dispose): same. * backend/pas/pas-backend-file.c (pas_backend_file_dispose): same. * backend/ebook/e-book-listener.c (e_book_listener_dispose): guard against multiple invocations. * backend/ebook/e-card.c (e_card_dispose): same. * backend/ebook/e-card-simple.c (e_card_simple_dispose): same. * backend/ebook/e-card-cursor.c (e_card_cursor_dispose): same. * backend/ebook/e-book.c (e_book_dispose): same. * backend/ebook/e-book-view-listener.c (e_book_view_listener_dispose): same. svn path=/trunk/; revision=18687
* use g_type_class_peek_parent.Chris Toshok2002-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-11-06 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-card-sexp.c (pas_backend_card_sexp_class_init): use g_type_class_peek_parent. * backend/pas/pas-card-cursor.c (pas_card_cursor_class_init): same. * backend/pas/pas-book-view.c (pas_book_view_class_init): same. * backend/pas/pas-book-factory.c (pas_book_factory_class_init): same. * backend/pas/pas-backend-summary.c (pas_backend_summary_class_init): same. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_class_init): same. * backend/pas/pas-backend-file.c (pas_backend_file_class_init): same. * backend/ebook/e-book-marshal.list: ENUM -> INT. * backend/ebook/e-book-view.c (e_book_view_dispose): guard against this being called multiple times. (e_book_view_class_init): ENUM -> INT in the sequence_complete signal. * backend/ebook/e-book.c (e_book_do_response_open): un-ifdef the component_died signal stuff. svn path=/trunk/; revision=18623
* port to gnome 2.Chris Toshok2002-11-051-27/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-11-05 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-card-sexp.[ch]: port to gnome 2. * backend/pas/pas-backend-file.[ch]: same. * backend/pas/pas-backend-file.[ch]: same. * backend/pas/pas-backend-ldap.[ch]: same. * backend/pas/pas-backend-summary.[ch]: same. * backend/pas/pas-backend.[ch]: same. * backend/pas/pas-book-factory.[ch]: same. * backend/pas/pas-book-view.[ch]: same. * backend/pas/pas-book.[ch]: same. * backend/pas/pas-card-cursor.[ch]: same. * backend/pas/pas-marshal.list: list of marshallers. * backend/pas/Makefile.am (libpas_a_SOURCES): add pas-marshal.c also add the marshal building foo. * backend/pas/.cvsignore: ignore pas-marshal.[ch] svn path=/trunk/; revision=18544
* [ fixes #27923] up the version to 4_0 (4000).Chris Toshok2002-08-301-4/+32
| | | | | | | | | | | | | | 2002-08-30 Chris Toshok <toshok@ximian.com> [ fixes #27923] * backend/pas/pas-backend-summary.c: up the version to 4_0 (4000). (pas_backend_summary_load_item): handle wants_html{_set}, list, and list_show_addresses. (pas_backend_summary_save_item): same. (pas_backend_summary_add_card): same. (pas_backend_summary_get_summary_vcard): same. svn path=/trunk/; revision=17932
* use strcasecmp here, since all the other helpers use case insensitiveChris Toshok2002-08-291-1/+1
| | | | | | | | | | | | 2002-08-29 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-card-sexp.c (is_helper): use strcasecmp here, since all the other helpers use case insensitive comparisons. * backend/pas/pas-backend-summary.c (is_helper): same. svn path=/trunk/; revision=17917
* initialize summary->upgraded to quiet valgrind.Chris Toshok2002-08-091-0/+1
| | | | | | | | | 2002-08-08 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-summary.c (pas_backend_summary_init): initialize summary->upgraded to quiet valgrind. svn path=/trunk/; revision=17749
* don't save empty strings. (pas_backend_summary_save): print out the errnoChris Toshok2002-07-281-2/+3
| | | | | | | | | | 2002-07-27 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-summary.c (save_string): don't save empty strings. (pas_backend_summary_save): print out the errno when we fail. svn path=/trunk/; revision=17623
* free the full_name (as well as given_name. oops.)Chris Toshok2002-07-131-31/+34
| | | | | | | | | | | | | | | | | | 2002-07-12 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-summary.c (free_summary_item): free the full_name (as well as given_name. oops.) (pas_backend_summary_new): new summaries are version 3.0 now. (pas_backend_summary_load_item): all loaded summaries should be 3.0+, as we fail to load versions lower than that. (pas_backend_summary_load_header): if the summary isn't version 3.0 fail out, as we need to rebuild the entire file to cache the full_name fields. (pas_backend_summary_save_item): save out the full_name. (pas_backend_summary_add_card): put the item's full_name in the card. svn path=/trunk/; revision=17447
* actually remove the items from the pointer array too, so an error whileChris Toshok2002-07-111-17/+47
| | | | | | | | | | | | | | | | | | | | | | | | | 2002-07-10 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-summary.c (clear_items): actually remove the items from the pointer array too, so an error while loading doesn't leave the memory summary corrupted. (pas_backend_summary_load_header): bleah, load the num_items and summary_mtime in the right order :) Also, set upgraded to TRUE if we loaded a v1.0 summary. (pas_backend_summary_open): make this return a gboolean, return TRUE if the summary is already open (priv->fp != NULL). return FALSE in error conditions. (pas_backend_summary_load): if summary_open returns FALSE, return FALSE, also set the dirty flag to FALSE after we load, and if the summary was upgraded write it out. (pas_backend_summary_save): update the in memory mtime to that of the file when we save. (summary_flush_func): if we're not dirty, do nothing and return. (pas_backend_summary_is_up_to_date): make sure we've opened the summary. (pas_backend_summary_get_summary_vcard): fix compiler warning. svn path=/trunk/; revision=17416
* add Book.getCompletionView.Chris Toshok2002-07-101-78/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-07-10 Chris Toshok <toshok@ximian.com> * backend/idl/addressbook.idl: add Book.getCompletionView. * backend/ebook/e-book.c (e_book_get_completion_view): new function, basically c&p of e_book_get_book_view, but call getCompletionView. * backend/ebook/e-book.h: add prototype for e_book_get_completion_view. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_process_client_requests): add a GetCompletionView case here that just calls the same code as GetBookView (since we don't build summaries for the ldap backend.) * backend/pas/pas-backend-file.c (do_summary_query): add @completion_search. If it's TRUE, just create the vcards from the summary using pas_backend_summary_get_summary_vcard instead of looking them up from the db. (pas_backend_file_search): add @completion_search and pass it on to do_summary_query. (pas_backend_file_process_get_book_view): pass FALSE to pas_backend_file_search. (pas_backend_file_process_get_completion_view): new function, basically c&p pas_backend_file_process_get_book_view, but pass TRUE to pas_backend_file_search. (pas_backend_file_process_client_requests): add a case for GetCompletionView. (pas_backend_file_load_uri): track the change to the summary api - create the summary filename * backend/pas/pas-book.c (pas_book_queue_get_completion_view): new function, queue a GetCompletionView request to our queue. (impl_GNOME_Evolution_Addressbook_Book_getCompletionView): new function, call pas_book_queue_get_completion_view. (pas_book_respond_get_completion_view): new function, just call notifyViewRequested. (pas_book_free_request): add a case for GetCompletionView. (pas_book_get_epv): fill in epv->getCompletionView. * backend/pas/pas-book.h: add a GetCompletionView PASOperation, and a new structure (PASGetCompletionViewRequest). Also, add get_completion_view to PASRequest. * backend/pas/pas-backend-summary.c (clear_items): remove the items from the hash table. (pas_backend_summary_new): db_path -> summary_path. (pas_backend_summary_destroy): db_.path -> summary_path, and destroy the hash table. (pas_backend_summary_init): db_path = summary_path, and initialize the id_to_item hashtable. (pas_backend_summary_load_header): handle the upgrading from version 1.0 to version 2.0 (the addition of an mtime field in the header) (pas_backend_summary_load_item): version 1.0 and 2.0 have the same format for items. (pas_backend_summary_open): new function. open the summary so we can load the header (and get the mtime). (pas_backend_summary_load): rework this a bit since the header has already been loaded, and also add the items to the hashtable. (pas_backend_summary_add_card): add the new item to the hashtable. (pas_backend_summary_remove_card): remove the item from the hash table. (pas_backend_summary_is_up_to_date): new function, chekc @t against the summary's mtime. (pas_backend_summary_get_summary_vcard): create a vcard from the fields we have in the summary. * backend/pas/pas-backend-summary.h: add prorotypes for pas_backend_summary_is_up_to_date and pas_backend_summary_get_summary_vcard. svn path=/trunk/; revision=17402
* add pas-backend-summary.[ch].Chris Toshok2002-06-301-0/+957
2002-06-29 Chris Toshok <toshok@ximian.com> * backend/pas/Makefile.am (libpas_a_SOURCES): add pas-backend-summary.[ch]. * backend/pas/pas-backend-file.c (string_to_dbt): move this to the top of the file so it can be used in.. (build_summary): loop over the db, adding cards ot the summary. (do_summary_query): call pas_backend_summary_search and loop over the returned id's looking them up in the db. (pas_backend_file_search): call pas_backend_summary_is_summary_query, and either call do_summary_query if it's a query over just the set of attributes in the summary or use the old, slow method if not. (pas_backend_file_process_create_card): call pas_backend_summary_add_card. (pas_backend_file_process_remove_card): call pas_backend_summary_remove_card. (pas_backend_file_process_modify_card): call remove_card/add_card. (pas_backend_file_load_uri): try to load the summary file, and if it doesn't exist create it. (pas_backend_file_destroy): unref the summary. * backend/pas/pas-backend-summary.[ch]: new files, reading and writing (and querying) summaries. svn path=/trunk/; revision=17330