aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-10-23 04:50:36 +0800
committerChris Toshok <toshok@src.gnome.org>2003-10-23 04:50:36 +0800
commitcbfab681c1576d4de27d48fbd6b4b7780670494a (patch)
tree70e99033907a1f5dada728e785835a07ca6ab98c /addressbook/backend/ebook
parentf7cbb839adf3fd47aa07ca2080063acd6fff6978 (diff)
downloadgsoc2013-evolution-cbfab681c1576d4de27d48fbd6b4b7780670494a.tar
gsoc2013-evolution-cbfab681c1576d4de27d48fbd6b4b7780670494a.tar.gz
gsoc2013-evolution-cbfab681c1576d4de27d48fbd6b4b7780670494a.tar.bz2
gsoc2013-evolution-cbfab681c1576d4de27d48fbd6b4b7780670494a.tar.lz
gsoc2013-evolution-cbfab681c1576d4de27d48fbd6b4b7780670494a.tar.xz
gsoc2013-evolution-cbfab681c1576d4de27d48fbd6b4b7780670494a.tar.zst
gsoc2013-evolution-cbfab681c1576d4de27d48fbd6b4b7780670494a.zip
use the synchronous api for this. simplifies it a bunch.
2003-10-21 Chris Toshok <toshok@ximian.com> * tools/evolution-addressbook-abuse.c: use the synchronous api for this. simplifies it a bunch. 2003-10-21 Chris Toshok <toshok@ximian.com> * backend/pas/pas-book.c (impl_GNOME_Evolution_Addressbook_Book_remove): we can ill afford bad debug spew. (view_listener_died_cb): implement. (impl_GNOME_Evolution_Addressbook_Book_getBookView): hook up an ORBit_small connection listener on the view's listener. (pas_book_respond_create): use e_contact_get_const instead of e_contact_get here. fixes a leak. * backend/pas/pas-book-view.c (impl_GNOME_Evolution_Addressbook_BookView_stop): implement, call pas_backend_stop_book_view. (pas_book_view_get_listener): return the book view's listener. (pas_book_view_class_init): fill in epv->stop. (pas_book_view_init): use a #define for THRESHOLD_MAX instead of the constant. * backend/pas/pas-book-view.h: add prototype for pas_book_view_get_listener. * backend/pas/pas-backend.c (pas_backend_stop_book_view): implement. (pas_backend_remove_book_view): implement. * backend/pas/pas-backend.h: add prototype for stop_book_view and remove_book_view. * backend/pas/pas-backend-vcf.c (load_file): pass in the fd and use fdopen here. (foreach_build_list): don't creat EContacts here, because we'll just be converting them back to vcards anyway. (save_file): use char*'s instead of EContacts, and split entries with 2 blank lines. Also, hold the lock over the entire function. (do_create): hold the lock around uid generation and touching the hash table. (pas_backend_vcf_process_remove_contacts): same. (pas_backend_vcf_process_modify_contact): same. (pas_backend_vcf_stop_book_view): new function, but leave unimplemented for now. (pas_backend_vcf_load_uri): the uri contains the directory name, not the filename. (pas_backend_vcf_dispose): grab the lock here just for sanity's sake. Also reorder things a bit, and free the hashtable and mutex. (pas_backend_vcf_init): init the mutex. * backend/pas/pas-backend-summary.c (pas_backend_summary_add_contact): don't unref the contact here. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_process_stop_book_view): new function, but leave unimplemented for now. * backend/pas/pas-backend-file.c (build_summary): use an EContact for this call. (do_summary_query): nuke, the contents of this has been moved to start_book_view. (pas_backend_file_search_timeout): same. (pas_backend_file_search): same. (pas_backend_file_start_book_view): glom everything into here involving searching. This function could (and should) be renamed and reused from both this function and _get_contact_list. (pas_backend_file_stop_book_view): new function. (pas_backend_file_class_init): fill in backend->stop_book_view. * backend/pas/Makefile.am (LDAP_BACKEND): libpasldap.a -> libpasldap.la (noinst_LTLIBRARIES): *.a -> *.la. (libpas_la_SOURCES): same. (libpasfile_la_SOURCES): same. (libpasvcf_la_SOURCES): same. (libpasldap_la_SOURCES): same. * backend/idl/addressbook.idl: add BookView::stop. * backend/ebook/e-vcard.c (read_attribute_value): fix GString related leaks. (read_attribute_params): same. (parse): don't leak the EVCardAttributes corresponding to BEGIN/END:vCard. (free_gstring): new function (e_vcard_attribute_remove_values): free the decoded_values list, using free_gstring. * backend/ebook/e-book.c (e_book_response_get_book_view): ref the listener here. * backend/ebook/e-book-view.h: add prototype for e_book_view_stop. * backend/ebook/e-book-view.c (e_book_view_stop): new function. * backend/ebook/e-book-async.c (_get_book_view_response_dtor): unref the book view. svn path=/trunk/; revision=23000
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r--addressbook/backend/ebook/e-book-async.c1
-rw-r--r--addressbook/backend/ebook/e-book-view.c12
-rw-r--r--addressbook/backend/ebook/e-book.c3
-rw-r--r--addressbook/backend/ebook/e-contact.h4
-rw-r--r--addressbook/backend/ebook/e-vcard.c34
5 files changed, 42 insertions, 12 deletions
diff --git a/addressbook/backend/ebook/e-book-async.c b/addressbook/backend/ebook/e-book-async.c
index 2ccc565eb9..d21f22a739 100644
--- a/addressbook/backend/ebook/e-book-async.c
+++ b/addressbook/backend/ebook/e-book-async.c
@@ -969,6 +969,7 @@ _get_book_view_response_dtor (EBookMsg *msg)
GetBookViewResponse *resp = (GetBookViewResponse*)msg;
g_object_unref (resp->book);
+ g_object_unref (resp->book_view);
g_free (resp);
}
diff --git a/addressbook/backend/ebook/e-book-view.c b/addressbook/backend/ebook/e-book-view.c
index e8468e35de..c36e87967c 100644
--- a/addressbook/backend/ebook/e-book-view.c
+++ b/addressbook/backend/ebook/e-book-view.c
@@ -204,9 +204,17 @@ e_book_view_start (EBookView *book_view)
void
e_book_view_stop (EBookView *book_view)
{
+ CORBA_Environment ev;
+
g_return_if_fail (book_view && E_IS_BOOK_VIEW (book_view));
- if (book_view->priv->listener)
- e_book_view_listener_stop (book_view->priv->listener);
+
+ CORBA_exception_init (&ev);
+
+ GNOME_Evolution_Addressbook_BookView_stop (book_view->priv->corba_book_view, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("corba exception._major = %d\n", ev._major);
+ }
}
static void
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
index 3883cd4b15..c84b4c3f83 100644
--- a/addressbook/backend/ebook/e-book.c
+++ b/addressbook/backend/ebook/e-book.c
@@ -1027,6 +1027,8 @@ e_book_response_get_book_view (EBook *book,
op->status = status;
op->view = e_book_view_new (corba_book_view, op->listener);
+ bonobo_object_ref(BONOBO_OBJECT(op->listener));
+
pthread_cond_signal (&op->cond);
e_mutex_unlock (op->mutex);
@@ -1677,7 +1679,6 @@ e_book_load_uri (EBook *book,
&ev);
if (ev._major != CORBA_NO_EXCEPTION) {
-
e_book_clear_op (book, our_op);
CORBA_exception_free (&ev);
diff --git a/addressbook/backend/ebook/e-contact.h b/addressbook/backend/ebook/e-contact.h
index 8de02caa5f..21c0256ca9 100644
--- a/addressbook/backend/ebook/e-contact.h
+++ b/addressbook/backend/ebook/e-contact.h
@@ -127,6 +127,10 @@ typedef enum {
E_CONTACT_BIRTH_DATE, /* structured field (EContactDate) */
E_CONTACT_ANNIVERSARY, /* structured field (EContactDate) */
+ /* Security Fields */
+ E_CONTACT_X509_CERT, /* string field */
+ E_CONTACT_X509_CERT_SHA1_FINGERPRINT, /* string field */
+
E_CONTACT_FIELD_LAST,
/* useful constants */
diff --git a/addressbook/backend/ebook/e-vcard.c b/addressbook/backend/ebook/e-vcard.c
index 7ea1d9da84..5207d0fefe 100644
--- a/addressbook/backend/ebook/e-vcard.c
+++ b/addressbook/backend/ebook/e-vcard.c
@@ -252,8 +252,8 @@ read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable
lp = g_utf8_next_char(lp);
}
else if (*lp == ';') {
- e_vcard_attribute_add_value (attr, g_string_free (str, FALSE));
- str = g_string_new ("");
+ e_vcard_attribute_add_value (attr, str->str);
+ g_string_assign (str, "");
lp = g_utf8_next_char(lp);
}
else {
@@ -261,8 +261,10 @@ read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable
lp = g_utf8_next_char(lp);
}
}
- if (str)
- e_vcard_attribute_add_value (attr, g_string_free (str, FALSE));
+ if (str) {
+ e_vcard_attribute_add_value (attr, str->str);
+ g_string_free (str, TRUE);
+ }
if (*lp == '\r') {
lp = g_utf8_next_char (lp); /* \n */
@@ -290,7 +292,7 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
if (*lp == '=') {
if (str->len > 0) {
param = e_vcard_attribute_param_new (str->str);
- str = g_string_assign (str, "");
+ g_string_assign (str, "");
lp = g_utf8_next_char (lp);
}
else {
@@ -311,7 +313,7 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
if (param) {
if (str->len > 0) {
e_vcard_attribute_param_add_value (param, str->str);
- str = g_string_assign (str, "");
+ g_string_assign (str, "");
if (!colon)
lp = g_utf8_next_char (lp);
}
@@ -354,7 +356,7 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
param = e_vcard_attribute_param_new (param_name);
e_vcard_attribute_param_add_value (param, str->str);
}
- str = g_string_assign (str, "");
+ g_string_assign (str, "");
if (!colon)
lp = g_utf8_next_char (lp);
}
@@ -376,7 +378,7 @@ read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printab
}
else {
g_warning ("invalid character found in parameter spec");
- str = g_string_assign (str, "");
+ g_string_assign (str, "");
skip_until (&lp, ":;");
}
}
@@ -514,6 +516,8 @@ parse (EVCard *evc, const char *str)
if (!attr || attr->group || g_ascii_strcasecmp (attr->name, "begin")) {
g_warning ("vcard began without a BEGIN:VCARD\n");
}
+ if (attr)
+ e_vcard_attribute_free (attr);
while (*p) {
EVCardAttribute *next_attr = read_attribute (&p);
@@ -529,6 +533,9 @@ parse (EVCard *evc, const char *str)
g_warning ("vcard ended without END:VCARD\n");
}
+ if (attr && !g_ascii_strcasecmp (attr->name, "end"))
+ e_vcard_attribute_free (attr);
+
g_free (buf);
}
@@ -712,7 +719,8 @@ e_vcard_to_string_vcard_30 (EVCard *evc)
attr_str = g_string_append (attr_str, CRLF);
- str = g_string_append (str, g_string_free (attr_str, FALSE));
+ str = g_string_append (str, attr_str->str);
+ g_string_free (attr_str, TRUE);
}
str = g_string_append (str, "END:vCard");
@@ -925,11 +933,19 @@ e_vcard_attribute_add_values (EVCardAttribute *attr,
va_end (ap);
}
+static void
+free_gstring (GString *str)
+{
+ g_string_free (str, TRUE);
+}
+
void
e_vcard_attribute_remove_values (EVCardAttribute *attr)
{
g_list_foreach (attr->values, (GFunc)g_free, NULL);
g_list_free (attr->values);
+ g_list_foreach (attr->decoded_values, (GFunc)free_gstring, NULL);
+ g_list_free (attr->decoded_values);
attr->values = NULL;
}