From 36948023ffbc80bb96bb2f9357640095bc45e409 Mon Sep 17 00:00:00 2001 From: Sivaiah Nallagatla Date: Wed, 1 Dec 2004 16:42:47 +0000 Subject: save the uid and set it again in the contact. Otherwise, there is 2004-12-01 Sivaiah Nallagatla * gui/contact-editor/e-contact-editor.c (save_contact) : save the uid and set it again in the contact. Otherwise, there is possibility we trying to save the contact wiht out UID, as we destory the contact and create new one when data is wrong svn path=/trunk/; revision=28033 --- addressbook/ChangeLog | 8 ++++++++ addressbook/gui/contact-editor/e-contact-editor.c | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 9f3bbf5ea6..c6792eb0e0 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,11 @@ +2004-12-01 Sivaiah Nallagatla + + * gui/contact-editor/e-contact-editor.c (save_contact) : + save the uid and set it again in the contact. Otherwise, there is + possibility we trying to save the contact wiht out UID, as we destory the + contact and create new one when data is wrong + + 2004-11-28 Sivaiah Nallagatla * gui/contact-editor/e-contact-editor.h : Define diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index d74b78b9f7..3bd1780a05 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2741,6 +2741,8 @@ real_save_contact (EContactEditor *ce, gboolean should_close) static void save_contact (EContactEditor *ce, gboolean should_close) { + char *uid; + if (!ce->target_book) return; @@ -2752,11 +2754,16 @@ save_contact (EContactEditor *ce, gboolean should_close) extract_all (ce); if (!e_contact_editor_is_valid (EAB_EDITOR (ce))) { + uid = e_contact_get (ce->contact, E_CONTACT_UID); g_object_unref (ce->contact); ce->contact = e_contact_new (); + if (uid) { + e_contact_set (ce->contact, E_CONTACT_UID, uid); + g_free (uid); + } return; } - + real_save_contact (ce, should_close); } -- cgit v1.2.3