diff options
-rw-r--r-- | addressbook/ChangeLog | 5 | ||||
-rw-r--r-- | addressbook/conduit/address-conduit.c | 30 | ||||
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/conduits/calendar/calendar-conduit.c | 21 | ||||
-rw-r--r-- | calendar/conduits/todo/todo-conduit.c | 23 | ||||
-rw-r--r-- | e-util/ChangeLog | 9 | ||||
-rw-r--r-- | e-util/Makefile.am | 13 | ||||
-rw-r--r-- | e-util/e-pilot-util.c | 56 | ||||
-rw-r--r-- | e-util/e-pilot-util.h | 29 |
9 files changed, 146 insertions, 48 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index e981ca6e0b..af3bbbbabd 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,8 @@ +2000-12-19 JP Rosevear <jpr@helixcode.com> + + * conduit/address-conduit.c (local_record_from_ecard): Convert ecard + strings to pilot encodings + 2000-12-19 Christopher James Lahey <clahey@helixcode.com> * gui/widgets/e-addressbook-view.c (delete): Made it so that if diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 4b7d85c0f2..87d95bd55a 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -23,12 +23,6 @@ */ #include <config.h> -#include <sys/stat.h> -#include <utime.h> -#include <unistd.h> -#include <pwd.h> -#include <signal.h> -#include <errno.h> #include <liboaf/liboaf.h> #include <bonobo.h> @@ -37,12 +31,12 @@ #include <pi-socket.h> #include <pi-file.h> #include <pi-dlp.h> -#include <pi-version.h> #include <ebook/e-book.h> #include <ebook/e-card-types.h> #include <ebook/e-card-cursor.h> #include <ebook/e-card.h> #include <ebook/e-card-simple.h> +#include <e-pilot-util.h> #define ADDR_CONFIG_LOAD 1 #define ADDR_CONFIG_DESTROY 1 @@ -55,7 +49,7 @@ GnomePilotConduit * conduit_get_gpilot_conduit (guint32); void conduit_destroy_gpilot_conduit (GnomePilotConduit*); -#define CONDUIT_VERSION "0.1.0" +#define CONDUIT_VERSION "0.1.1" #ifdef G_LOG_DOMAIN #undef G_LOG_DOMAIN #endif @@ -304,22 +298,22 @@ local_record_from_ecard (EAddrLocalRecord *local, ECard *ecard, EAddrConduitCont if (ecard->name) { if (ecard->name->given) - local->addr->entry[entryFirstname] = strdup (ecard->name->given); + local->addr->entry[entryFirstname] = e_pilot_utf8_to_pchar (ecard->name->given); if (ecard->name->family) - local->addr->entry[entryLastname] = strdup (ecard->name->family); + local->addr->entry[entryLastname] = e_pilot_utf8_to_pchar (ecard->name->family); if (ecard->org) - local->addr->entry[entryCompany] = strdup (ecard->org); + local->addr->entry[entryCompany] = e_pilot_utf8_to_pchar (ecard->org); if (ecard->title) - local->addr->entry[entryTitle] = strdup (ecard->title); + 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); if (delivery) { - local->addr->entry[entryAddress] = strdup (delivery->street); - local->addr->entry[entryCity] = strdup (delivery->city); - local->addr->entry[entryState] = strdup (delivery->region); - local->addr->entry[entryZip] = strdup (delivery->code); - local->addr->entry[entryCountry] = strdup (delivery->country); + local->addr->entry[entryAddress] = e_pilot_utf8_to_pchar (delivery->street); + local->addr->entry[entryCity] = e_pilot_utf8_to_pchar (delivery->city); + local->addr->entry[entryState] = e_pilot_utf8_to_pchar (delivery->region); + local->addr->entry[entryZip] = e_pilot_utf8_to_pchar (delivery->code); + local->addr->entry[entryCountry] = e_pilot_utf8_to_pchar (delivery->country); } for (i = 0; i <= 7; i++) { @@ -344,7 +338,7 @@ local_record_from_ecard (EAddrLocalRecord *local, ECard *ecard, EAddrConduitCont phone_str = e_card_simple_get_const (simple, E_CARD_SIMPLE_FIELD_PHONE_MOBILE); if (phone_str) { - local->addr->entry[phone] = strdup (phone_str); + local->addr->entry[phone] = e_pilot_utf8_to_pchar (phone_str); local->addr->phoneLabel[phone - entryPhone1] = i; phone++; } diff --git a/calendar/ChangeLog b/calendar/ChangeLog index e84c8615b0..3dd356e39d 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2000-12-19 JP Rosevear <jpr@helixcode.com> + + * conduits/calendar/calendar-conduit.c (local_record_from_comp): + Convert cal component strings to pilot character set + (comp_from_remote_record): vice versa + + * conduits/todo/todo-conduit.c: Same as above + 2000-12-19 Federico Mena Quintero <federico@helixcode.com> * pcs/cal-backend-file.c (compute_alarm_range): Fix confusion in diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c index da3a9f2fab..45f4aa0a08 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -23,16 +23,9 @@ */ #include <config.h> -#include <sys/stat.h> -#include <utime.h> -#include <unistd.h> -#include <pwd.h> -#include <signal.h> -#include <errno.h> #include <liboaf/liboaf.h> #include <bonobo.h> -#include <gnome-xml/parser.h> #include <cal-client/cal-client-types.h> #include <cal-client/cal-client.h> #include <cal-util/timeutil.h> @@ -40,8 +33,8 @@ #include <pi-socket.h> #include <pi-file.h> #include <pi-dlp.h> -#include <pi-version.h> #include <libical/src/libical/icaltypes.h> +#include <e-pilot-util.h> #define CAL_CONFIG_LOAD 1 #define CAL_CONFIG_DESTROY 1 @@ -54,7 +47,7 @@ GnomePilotConduit * conduit_get_gpilot_conduit (guint32); void conduit_destroy_gpilot_conduit (GnomePilotConduit*); -#define CONDUIT_VERSION "0.1.3" +#define CONDUIT_VERSION "0.1.4" #ifdef G_LOG_DOMAIN #undef G_LOG_DOMAIN #endif @@ -375,13 +368,13 @@ local_record_from_comp (ECalLocalRecord *local, CalComponent *comp, ECalConduitC uses free to deallocate */ cal_component_get_summary (comp, &summary); if (summary.value) - local->appt->description = strdup ((char *) summary.value); + local->appt->description = e_pilot_utf8_to_pchar (summary.value); cal_component_get_description_list (comp, &d_list); if (d_list) { description = (CalComponentText *) d_list->data; if (description && description->value) - local->appt->note = strdup (description->value); + local->appt->note = e_pilot_utf8_to_pchar (description->value); else local->appt->note = NULL; } else { @@ -540,8 +533,9 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, cal_component_set_last_modified (comp, &now); - summary.value = appt.description; + summary.value = e_pilot_utf8_from_pchar (appt.description); cal_component_set_summary (comp, &summary); + free (summary.value); /* The iCal description field */ if (!appt.note) { @@ -550,12 +544,13 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, GSList l; CalComponentText text; - text.value = appt.note; + text.value = e_pilot_utf8_from_pchar (appt.note); text.altrep = NULL; l.data = &text; l.next = NULL; cal_component_set_description_list (comp, &l); + free (text.value); } if (!is_empty_time (appt.begin)) { diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c index 2ef5bc0b76..09676cee73 100644 --- a/calendar/conduits/todo/todo-conduit.c +++ b/calendar/conduits/todo/todo-conduit.c @@ -23,16 +23,9 @@ */ #include <config.h> -#include <sys/stat.h> -#include <utime.h> -#include <unistd.h> -#include <pwd.h> -#include <signal.h> -#include <errno.h> #include <liboaf/liboaf.h> #include <bonobo.h> -#include <gnome-xml/parser.h> #include <cal-client/cal-client-types.h> #include <cal-client/cal-client.h> #include <cal-util/timeutil.h> @@ -40,8 +33,8 @@ #include <pi-socket.h> #include <pi-file.h> #include <pi-dlp.h> -#include <pi-version.h> #include <libical/src/libical/icaltypes.h> +#include <e-pilot-util.h> #define TODO_CONFIG_LOAD 1 #define TODO_CONFIG_DESTROY 1 @@ -54,7 +47,7 @@ GnomePilotConduit * conduit_get_gpilot_conduit (guint32); void conduit_destroy_gpilot_conduit (GnomePilotConduit*); -#define CONDUIT_VERSION "0.1.2" +#define CONDUIT_VERSION "0.1.3" #ifdef G_LOG_DOMAIN #undef G_LOG_DOMAIN #endif @@ -318,13 +311,13 @@ local_record_from_comp (EToDoLocalRecord *local, CalComponent *comp, EToDoCondui uses free to deallocate */ cal_component_get_summary (comp, &summary); if (summary.value) - local->todo->description = strdup ((char *) summary.value); + local->todo->description = e_pilot_utf8_to_pchar (summary.value); cal_component_get_description_list (comp, &d_list); if (d_list) { description = (CalComponentText *) d_list->data; if (description && description->value) - local->todo->note = strdup (description->value); + local->todo->note = e_pilot_utf8_to_pchar (description->value); else local->todo->note = NULL; } else { @@ -415,9 +408,10 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, cal_component_set_last_modified (comp, &now); - summary.value = todo.description; + summary.value = e_pilot_utf8_from_pchar (todo.description); cal_component_set_summary (comp, &summary); - + free (summary.value); + /* The iCal description field */ if (!todo.note) { cal_component_set_comment_list (comp, NULL); @@ -425,12 +419,13 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, GSList l; CalComponentText text; - text.value = todo.note; + text.value = e_pilot_utf8_from_pchar (todo.note); text.altrep = NULL; l.data = &text; l.next = NULL; cal_component_set_description_list (comp, &l); + free (text.value); } if (todo.complete) { diff --git a/e-util/ChangeLog b/e-util/ChangeLog index fa3d554f78..acfa209e41 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,12 @@ +2000-12-19 JP Rosevear <jpr@helixcode.com> + + * e-pilot-util.c (e_pilot_utf8_to_pchar): Convert utf8 strings to + pilot character set + (e_pilot_utf8_from_pchar): vice versa + + * Makefile.am: Conditionally build e-pilot-util.[hc] because + they depend on pilot-link stuff + 2000-12-13 Larry Ewing <lewing@helixcode.com> * e-html-utils.c (e_text_to_html): make sure we actually make diff --git a/e-util/Makefile.am b/e-util/Makefile.am index e01b827ede..eb42fef5e0 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -7,9 +7,9 @@ INCLUDES = \ $(GNOME_INCLUDEDIR) \ $(EXTRA_GNOME_CFLAGS) \ $(UNICODE_CFLAGS) \ + $(PISOCK_INCLUDEDIR) \ -DEVOLUTION_IMAGES=\""$(imagesdir)"\" \ - -DG_LOG_DOMAIN=\"e-utils\" \ - $(UNICODE_CFLAGS) + -DG_LOG_DOMAIN=\"e-utils\" noinst_LTLIBRARIES = libeutil.la libeutil-static.la \ libeconduit.la libeconduit-static.la @@ -45,9 +45,16 @@ libeutil_la_LIBADD = $(UNICODE_LIBS) libeutil_static_la_SOURCES = $(libeutil_la_SOURCES) libeutil_static_la_LDFLAGS = --all-static +if ENABLE_PILOT_CONDUITS +pl_needed = e-pilot-util.c e-pilot-util.h +else +pl_needed = +endif + libeconduit_la_SOURCES = \ e-pilot-map.c \ - e-pilot-map.h + e-pilot-map.h \ + $(pl_needed) libeconduit_static_la_SOURCES = $(libeconduit_la_SOURCES) libeconduit_static_la_LDFLAGS = --all-static diff --git a/e-util/e-pilot-util.c b/e-util/e-pilot-util.c new file mode 100644 index 0000000000..93bf9aa1b2 --- /dev/null +++ b/e-util/e-pilot-util.c @@ -0,0 +1,56 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* Evolution Conduits - Pilot Map routines + * + * Copyright (C) 2000 Helix Code, Inc. + * + * Authors: JP Rosevear <jpr@helixcode.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#include <stdlib.h> +#include <time.h> +#include <gnome.h> +#include <gnome-xml/parser.h> +#include <pi-util.h> +#include <e-pilot-util.h> + +char * +e_pilot_utf8_to_pchar (const char *string) +{ + char *pstring = NULL; + int res; + + res = convert_ToPilotChar ("UTF8", string, strlen (string), &pstring); + + if (res != 0) + pstring = strdup (string); + + return pstring; +} + +char * +e_pilot_utf8_from_pchar (const char *string) +{ + char *ustring = NULL; + int res; + + res = convert_FromPilotChar ("UTF8", string, strlen (string), &ustring); + + if (res != 0) + ustring = strdup (ustring); + + return ustring; +} diff --git a/e-util/e-pilot-util.h b/e-util/e-pilot-util.h new file mode 100644 index 0000000000..076bd1102e --- /dev/null +++ b/e-util/e-pilot-util.h @@ -0,0 +1,29 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* Evolution Conduits - Pilot Map routines + * + * Copyright (C) 2000 Helix Code, Inc. + * + * Authors: JP Rosevear <jpr@helixcode.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef E_PILOT_UTIL_H +#define E_PILOT_UTIL_H + +char *e_pilot_utf8_to_pchar (const char *string); +char *e_pilot_utf8_from_pchar (const char *string); + +#endif /* E_PILOT_UTIL_H */ |