aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-04-13 02:44:41 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-04-13 02:44:41 +0800
commit0f6c6bbb8cb76ba673a10b11407100d02919be04 (patch)
treeb8da73b04d48e717a78cb7987739fc7e3f8027bd
parentd7cd78ec3ba3a7fb8331dde5ea8118cb328726a9 (diff)
downloadgsoc2013-evolution-0f6c6bbb8cb76ba673a10b11407100d02919be04.tar.gz
gsoc2013-evolution-0f6c6bbb8cb76ba673a10b11407100d02919be04.tar.zst
gsoc2013-evolution-0f6c6bbb8cb76ba673a10b11407100d02919be04.zip
put the business address into the pilot record as that is what we put into
2001-04-12 JP Rosevear <jpr@ximian.com> * conduit/address-conduit.c (local_record_from_ecard): put the business address into the pilot record as that is what we put into the desktop record (ecard_from_remote_record): set both the address label and delivery address to avoid bad parser guessing, fixes #2143 * backend/ebook/e-card-types.h: remove deprecated pilot code * backend/ebook/e-card.c: ditto * backend/ebook/e-card.h: ditto svn path=/trunk/; revision=9279
-rw-r--r--addressbook/ChangeLog14
-rw-r--r--addressbook/backend/ebook/e-card-types.h8
-rw-r--r--addressbook/backend/ebook/e-card.c60
-rw-r--r--addressbook/backend/ebook/e-card.h2
-rw-r--r--addressbook/conduit/address-conduit.c18
5 files changed, 24 insertions, 78 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 8a562a449e..a23891f3e0 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,17 @@
+2001-04-12 JP Rosevear <jpr@ximian.com>
+
+ * conduit/address-conduit.c (local_record_from_ecard): put the
+ business address into the pilot record as that is what we put into
+ the desktop record
+ (ecard_from_remote_record): set both the address label and
+ delivery address to avoid bad parser guessing, fixes #2143
+
+ * backend/ebook/e-card-types.h: remove deprecated pilot code
+
+ * backend/ebook/e-card.c: ditto
+
+ * backend/ebook/e-card.h: ditto
+
2001-04-11 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c (local_record_from_ecard): Don't add
diff --git a/addressbook/backend/ebook/e-card-types.h b/addressbook/backend/ebook/e-card-types.h
index a2563d4bf6..57aed690aa 100644
--- a/addressbook/backend/ebook/e-card-types.h
+++ b/addressbook/backend/ebook/e-card-types.h
@@ -86,12 +86,4 @@ typedef struct {
char *value;
} ECardArbitrary;
-/* PILOT SYNC STATUS */
-
-enum {
- E_CARD_PILOT_STATUS_NONE,
- E_CARD_PILOT_STATUS_MOD,
- E_CARD_PILOT_STATUS_DEL
-};
-
#endif /* __E_CARD_TYPES_H__ */
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 435d8fef51..ca160f0905 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -29,8 +29,6 @@
#define str_val(obj) (the_str = (vObjectValueType (obj))? fakeCString (vObjectUStringZValue (obj)) : calloc (1, 1))
#define has(obj,prop) (vo = isAPropertyOf ((obj), (prop)))
-#define XEV_PILOT_ID "X-EVOLUTION-PILOTID"
-#define XEV_PILOT_STATUS "X-EVOLUTION-PILOTSTATUS"
#define XEV_WANTS_HTML "X-MOZILLA-HTML"
#define XEV_ARBITRARY "X-EVOLUTION-ARBITRARY"
@@ -63,8 +61,6 @@ enum {
ARG_CATEGORY_LIST,
ARG_WANTS_HTML,
ARG_WANTS_HTML_SET,
- ARG_PILOTID,
- ARG_PILOTSTATUS,
ARG_ARBITRARY,
ARG_ID,
};
@@ -108,8 +104,6 @@ static void parse_fburl(ECard *card, VObject *object);
static void parse_note(ECard *card, VObject *object);
static void parse_categories(ECard *card, VObject *object);
static void parse_wants_html(ECard *card, VObject *object);
-static void parse_pilot_id(ECard *card, VObject *object);
-static void parse_pilot_status(ECard *card, VObject *object);
static void parse_arbitrary(ECard *card, VObject *object);
static void parse_id(ECard *card, VObject *object);
@@ -148,8 +142,6 @@ struct {
{ VCNoteProp, parse_note },
{ "CATEGORIES", parse_categories },
{ XEV_WANTS_HTML, parse_wants_html },
- { XEV_PILOT_ID, parse_pilot_id },
- { XEV_PILOT_STATUS, parse_pilot_status },
{ XEV_ARBITRARY, parse_arbitrary },
{ VCUniqueStringProp, parse_id }
};
@@ -459,20 +451,6 @@ char
addPropValue (vobj, XEV_WANTS_HTML, card->wants_html ? "TRUE" : "FALSE");
}
- if (card->pilot_id) {
- gchar *pilotid_str;
- pilotid_str = g_strdup_printf ("%d", card->pilot_id);
- addPropValue (vobj, XEV_PILOT_ID, pilotid_str);
- g_free (pilotid_str);
- }
-
- if (card->pilot_status) {
- gchar *pilotstatus_str;
- pilotstatus_str = g_strdup_printf ("%d", card->pilot_status);
- addPropValue (vobj, XEV_PILOT_STATUS, pilotstatus_str);
- g_free (pilotstatus_str);
- }
-
if (card->arbitrary) {
EIterator *iterator;
for (iterator = e_list_get_iterator(card->arbitrary); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
@@ -880,26 +858,6 @@ parse_wants_html(ECard *card, VObject *vobj)
}
}
-static void
-parse_pilot_id(ECard *card, VObject *vobj)
-{
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- card->pilot_id = atoi(str);
- free(str);
- }
-}
-
-static void
-parse_pilot_status(ECard *card, VObject *vobj)
-{
- if ( vObjectValueType (vobj) ) {
- char *str = fakeCString (vObjectUStringZValue (vobj));
- card->pilot_status = atoi(str);
- free(str);
- }
-}
-
typedef union ValueItem {
const char *strs;
const wchar_t *ustrs;
@@ -1055,10 +1013,6 @@ e_card_class_init (ECardClass *klass)
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_WANTS_HTML);
gtk_object_add_arg_type ("ECard::wants_html_set",
GTK_TYPE_BOOL, GTK_ARG_READABLE, ARG_WANTS_HTML);
- gtk_object_add_arg_type ("ECard::pilot_id",
- GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_PILOTID);
- gtk_object_add_arg_type ("ECard::pilot_status",
- GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_PILOTSTATUS);
gtk_object_add_arg_type ("ECard::arbitrary",
GTK_TYPE_OBJECT, GTK_ARG_READWRITE, ARG_ARBITRARY);
gtk_object_add_arg_type ("ECard::id",
@@ -1743,12 +1697,6 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
card->wants_html = GTK_VALUE_BOOL(*arg);
card->wants_html_set = TRUE;
break;
- case ARG_PILOTID:
- card->pilot_id = GTK_VALUE_INT(*arg);
- break;
- case ARG_PILOTSTATUS:
- card->pilot_status = GTK_VALUE_INT(*arg);
- break;
case ARG_ARBITRARY:
if (card->arbitrary)
gtk_object_unref(GTK_OBJECT(card->arbitrary));
@@ -1889,12 +1837,6 @@ e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
case ARG_WANTS_HTML_SET:
GTK_VALUE_BOOL(*arg) = card->wants_html_set;
break;
- case ARG_PILOTID:
- GTK_VALUE_INT(*arg) = card->pilot_id;
- break;
- case ARG_PILOTSTATUS:
- GTK_VALUE_INT(*arg) = card->pilot_status;
- break;
case ARG_ARBITRARY:
if (!card->arbitrary)
card->arbitrary = e_list_new((EListCopyFunc) e_card_arbitrary_copy,
@@ -1946,8 +1888,6 @@ e_card_init (ECard *card)
card->categories = NULL;
card->wants_html = FALSE;
card->wants_html_set = FALSE;
- card->pilot_id = 0;
- card->pilot_status = 0;
card->arbitrary = NULL;
#if 0
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index 5c0865ab50..90d345b62c 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -74,8 +74,6 @@ struct _ECard {
guint32 wants_html : 1; /* Wants html mail. */
guint32 wants_html_set : 1; /* Wants html mail. */
- guint32 pilot_id; /* id of the corresponding pilot */
- guint32 pilot_status; /* status information */
#if 0
ECardPhoto *logo; /* This person's org's logo. */
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c
index 78db75c99d..428584b9c4 100644
--- a/addressbook/conduit/address-conduit.c
+++ b/addressbook/conduit/address-conduit.c
@@ -363,7 +363,7 @@ local_record_from_ecard (EAddrLocalRecord *local, ECard *ecard, EAddrConduitCont
local->addr->entry[entryTitle] = e_pilot_utf8_to_pchar (ecard->title);
}
- delivery = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
+ delivery = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS);
if (delivery) {
local->addr->entry[entryAddress] = e_pilot_utf8_to_pchar (delivery->street);
local->addr->entry[entryCity] = e_pilot_utf8_to_pchar (delivery->city);
@@ -434,6 +434,7 @@ ecard_from_remote_record(EAddrConduitContext *ctxt,
ECard *ecard;
ECardSimple *simple;
ECardDeliveryAddress delivery;
+ ECardAddrLabel label;
char *string;
char *stringparts[3];
int i;
@@ -474,7 +475,7 @@ ecard_from_remote_record(EAddrConduitContext *ctxt,
/* Address */
memset (&delivery, 0, sizeof (ECardDeliveryAddress));
- delivery.flags = E_CARD_ADDR_HOME;
+ delivery.flags = E_CARD_ADDR_WORK;
if (address.entry[entryAddress])
delivery.street = get_entry_text (address, entryAddress);
if (address.entry[entryCity])
@@ -486,16 +487,19 @@ ecard_from_remote_record(EAddrConduitContext *ctxt,
if (address.entry[entryZip])
delivery.code = get_entry_text (address, entryZip);
- string = e_card_delivery_address_to_string (&delivery);
- e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS, string);
- g_free (string);
+ label.flags = E_CARD_ADDR_WORK;
+ label.data = e_card_delivery_address_to_string (&delivery);
+
+ e_card_simple_set_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, &label);
+ e_card_simple_set_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_BUSINESS, &delivery);
free (delivery.street);
free (delivery.city);
free (delivery.region);
free (delivery.country);
free (delivery.code);
-
+ g_free (label.data);
+
/* Phone numbers */
for (i = entryPhone1; i <= entryPhone5; i++) {
char *phonelabel = ctxt->ai.phoneLabels[address.phoneLabel[i - entryPhone1]];
@@ -517,8 +521,6 @@ ecard_from_remote_record(EAddrConduitContext *ctxt,
e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_PAGER, phonenum);
else if (!strcmp (phonelabel, "Mobile"))
e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_MOBILE, phonenum);
-
- g_print (" ['%s' : '%s']\n", phonelabel, phonenum);
g_free (phonenum);
}