aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook/e-card.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-09-11 17:59:30 +0800
committerChris Lahey <clahey@src.gnome.org>2000-09-11 17:59:30 +0800
commitd65fb37051402d1df0d125540546f63cc6b46ea6 (patch)
tree287b9cc05ed644eab851b234dc837c16d457d611 /addressbook/backend/ebook/e-card.c
parente30911d7d0806677fbd6ee239d0c47284c05a228 (diff)
downloadgsoc2013-evolution-d65fb37051402d1df0d125540546f63cc6b46ea6.tar
gsoc2013-evolution-d65fb37051402d1df0d125540546f63cc6b46ea6.tar.gz
gsoc2013-evolution-d65fb37051402d1df0d125540546f63cc6b46ea6.tar.bz2
gsoc2013-evolution-d65fb37051402d1df0d125540546f63cc6b46ea6.tar.lz
gsoc2013-evolution-d65fb37051402d1df0d125540546f63cc6b46ea6.tar.xz
gsoc2013-evolution-d65fb37051402d1df0d125540546f63cc6b46ea6.tar.zst
gsoc2013-evolution-d65fb37051402d1df0d125540546f63cc6b46ea6.zip
Removed a bunch of redundant code. Made it so that when you set an address
2000-09-11 Christopher James Lahey <clahey@helixcode.com> * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h: Removed a bunch of redundant code. Made it so that when you set an address label, it sets the delivery address as well. Added functions to set and get the delivery address. * backend/ebook/e-card.c, backend/ebook/e-card.h: Added code to convert and address label to a delivery address. * contact-editor/Makefile.am: Added e-contact-editor-address.[ch], fulladdr.glade, fulladdr.glade.h. * contact-editor/contact-editor.glade, contact-editor/e-contact-editor-strings.h: Switched from a label to a button to show the parsed address. * contact-editor/e-contact-editor-address.c, contact-editor/e-contact-editor-address.h: New class to implement the parsed address dialog. * contact-editor/e-contact-editor-fullname.c, contact-editor/e-contact-editor-fullname.h: Added const to the _new function. * contact-editor/e-contact-editor.c: Implemented clicking on the address button. * contact-editor/fulladdr.glade, contact-editor/fulladdr.glade.h: New glade files for the parsed address dialog. * contact-editor/fullname-strings.h, fullname.glade: Changed these accellabels to labels. * ename/Makefile.am: Added e-address-western.c. * ename/e-address-western.c: Fixed some warnings. svn path=/trunk/; revision=5317
Diffstat (limited to 'addressbook/backend/ebook/e-card.c')
-rw-r--r--addressbook/backend/ebook/e-card.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index be18e1c359..83f321bc24 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -18,6 +18,7 @@
#include "e-card.h"
#include "e-card-pairs.h"
#include "e-name-western.h"
+#include "e-address-western.h"
#include <e-util/e-util.h>
@@ -295,7 +296,9 @@ char
addPropValue(addressprop, VCPostalCodeProp, address->code);
if ( address->country )
addPropValue(addressprop, VCCountryNameProp, address->country);
+#if 0
addProp(addressprop, VCQuotedPrintableProp);
+#endif
}
gtk_object_unref(GTK_OBJECT(iterator));
}
@@ -1108,6 +1111,38 @@ e_card_delivery_address_copy (const ECardDeliveryAddress *addr)
return NULL;
}
+gboolean
+e_card_delivery_address_is_empty (const ECardDeliveryAddress *addr)
+{
+ return (((addr->po == NULL) || (*addr->po == 0)) &&
+ ((addr->ext == NULL) || (*addr->ext == 0)) &&
+ ((addr->street == NULL) || (*addr->street == 0)) &&
+ ((addr->city == NULL) || (*addr->city == 0)) &&
+ ((addr->region == NULL) || (*addr->region == 0)) &&
+ ((addr->code == NULL) || (*addr->code == 0)) &&
+ ((addr->country == NULL) || (*addr->country == 0)));
+}
+
+ECardDeliveryAddress *
+e_card_delivery_address_from_label(const ECardAddrLabel *label)
+{
+ ECardDeliveryAddress *addr = g_new(ECardDeliveryAddress, 1);
+ EAddressWestern *western = e_address_western_parse (label->data);
+
+ addr->po = g_strdup (western->po_box );
+ addr->ext = g_strdup (western->extended );
+ addr->street = g_strdup (western->street );
+ addr->city = g_strdup (western->locality );
+ addr->region = g_strdup (western->region );
+ addr->code = g_strdup (western->postal_code);
+ addr->country = g_strdup (western->country );
+ addr->flags = label->flags;
+
+ e_address_western_free(western);
+
+ return addr;
+}
+
char *
e_card_delivery_address_to_string(const ECardDeliveryAddress *addr)
{