aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-10-16 07:13:52 +0800
committerChris Toshok <toshok@src.gnome.org>2001-10-16 07:13:52 +0800
commit31c48795638fe625ac2f19d01cb9791104768424 (patch)
tree88f0e7617ed6913b69d52b36ed59465e2364c9b1 /addressbook
parent4bcda57628342b0015417c5cf9c2932e1f8e8f54 (diff)
downloadgsoc2013-evolution-31c48795638fe625ac2f19d01cb9791104768424.tar.gz
gsoc2013-evolution-31c48795638fe625ac2f19d01cb9791104768424.tar.zst
gsoc2013-evolution-31c48795638fe625ac2f19d01cb9791104768424.zip
unref op->view. (pas_backend_ldap_process_create_card): ref op->view.
2001-10-15 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-ldap.c (create_card_dtor): unref op->view. (pas_backend_ldap_process_create_card): ref op->view. (remove_card_dtor): unref op->view. (pas_backend_ldap_process_remove_card): ref op->view. (modify_card_dtor): unref op->view. (pas_backend_ldap_process_modify_card): ref op->view. (ldap_search_dtor): unref op->view. (pas_backend_ldap_search): ref op->view. svn path=/trunk/; revision=13690
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog12
-rw-r--r--addressbook/backend/pas/pas-backend-file.c30
2 files changed, 39 insertions, 3 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 9dfd5c6717..f71b433b0b 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,17 @@
2001-10-15 Chris Toshok <toshok@ximian.com>
+ * backend/pas/pas-backend-ldap.c (create_card_dtor): unref
+ op->view.
+ (pas_backend_ldap_process_create_card): ref op->view.
+ (remove_card_dtor): unref op->view.
+ (pas_backend_ldap_process_remove_card): ref op->view.
+ (modify_card_dtor): unref op->view.
+ (pas_backend_ldap_process_modify_card): ref op->view.
+ (ldap_search_dtor): unref op->view.
+ (pas_backend_ldap_search): ref op->view.
+
+2001-10-15 Chris Toshok <toshok@ximian.com>
+
* backend/pas/pas-backend-ldap.c
(pas_backend_ldap_process_get_book_view): make sure to unref the
book_view here so we don't leak them.
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index 56c6485e7f..08698a74ca 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -508,6 +508,7 @@ do_create(PASBackend *backend,
}
else {
+ g_free (id);
ret_val = NULL;
}
@@ -575,8 +576,20 @@ pas_backend_file_process_remove_card (PASBackend *backend,
int db_error;
EIterator *iterator;
char *vcard_string;
+ const char *id;
- string_to_dbt (req->id, &id_dbt);
+ /* This is disgusting, but for a time cards were added with
+ ID's that are no longer used (they contained both the uri
+ and the id.) If we recognize it as a uri (file:///...) trim
+ off everything before the last '/', and use that as the
+ id.*/
+ if (!strncmp (req->id, "file:///", strlen ("file:///"))) {
+ id = strrchr (req->id, '/') + 1;
+ }
+ else
+ id = req->id;
+
+ string_to_dbt (id, &id_dbt);
memset (&vcard_dbt, 0, sizeof (vcard_dbt));
db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
@@ -632,14 +645,25 @@ pas_backend_file_process_modify_card (PASBackend *backend,
int db_error;
EIterator *iterator;
ECard *card;
- const char *id;
+ const char *id, *lookup_id;
char *old_vcard_string;
/* create a new ecard from the request data */
card = e_card_new(req->vcard);
id = e_card_get_id(card);
- string_to_dbt (id, &id_dbt);
+ /* This is disgusting, but for a time cards were added with
+ ID's that are no longer used (they contained both the uri
+ and the id.) If we recognize it as a uri (file:///...) trim
+ off everything before the last '/', and use that as the
+ id.*/
+ if (!strncmp (id, "file:///", strlen ("file:///"))) {
+ lookup_id = strrchr (id, '/') + 1;
+ }
+ else
+ lookup_id = id;
+
+ string_to_dbt (lookup_id, &id_dbt);
memset (&vcard_dbt, 0, sizeof (vcard_dbt));
/* get the old ecard - the one that's presently in the db */