From cd0b27c3829d31fcf7533e077e1cfd36f61a9c6f Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Tue, 19 Dec 2006 20:02:46 +0000 Subject: [PATCH] 2006-12-19 [colin] 2.6.1cvs55 * src/jpilot.c Same as before, without depending on pisock >= 0.12 --- ChangeLog | 6 ++++++ PATCHSETS | 1 + configure.ac | 4 ++-- src/jpilot.c | 57 ++++++++++++++++++---------------------------------- 4 files changed, 28 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0e15a11df..c9201eef7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-12-19 [colin] 2.6.1cvs55 + + * src/jpilot.c + Same as before, without depending on + pisock >= 0.12 + 2006-12-19 [colin] 2.6.1cvs54 * src/jpilot.c diff --git a/PATCHSETS b/PATCHSETS index 790d96fff..28bbaa3dc 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2162,3 +2162,4 @@ ( cvs diff -u -r 1.4.2.45 -r 1.4.2.46 src/gtk/about.c; ) > 2.6.1cvs52.patchset ( cvs diff -u -r 1.42.2.28 -r 1.42.2.29 po/fr.po; ) > 2.6.1cvs53.patchset ( cvs diff -u -r 1.18.2.18 -r 1.18.2.19 src/jpilot.c; ) > 2.6.1cvs54.patchset +( cvs diff -u -r 1.18.2.19 -r 1.18.2.20 src/jpilot.c; ) > 2.6.1cvs55.patchset diff --git a/configure.ac b/configure.ac index 2f405a996..d9a094e14 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=6 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=54 +EXTRA_VERSION=55 EXTRA_RELEASE= EXTRA_GTK2_VERSION= @@ -587,7 +587,7 @@ if test "$ac_cv_enable_jpilot" = yes; then AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) ]) fi - AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock -lpisync"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"]) + AC_CHECK_LIB(pisock, unpack_Address, [JPILOT_LIBS="-lpisock"], [JPILOT_LIBS="" ac_cv_enable_jpilot="no"]) if test x"$ac_cv_enable_jpilot" = xyes; then AC_DEFINE(USE_JPILOT, 1, Define if you want JPilot support in addressbook.) else diff --git a/src/jpilot.c b/src/jpilot.c index 2b80ff10d..83daba2da 100644 --- a/src/jpilot.c +++ b/src/jpilot.c @@ -38,13 +38,11 @@ #include #ifdef HAVE_LIBPISOCK_PI_ARGS_H -# include # include # include # include # include #else -# include # include # include # include @@ -160,6 +158,19 @@ enum { gboolean convert_charcode = TRUE; +static const gchar *jpilot_get_charset(void) +{ + static const gchar *charset = NULL; + + if (charset == NULL) + charset = getenv("PILOT_CHARSET"); + + if (charset == NULL) + charset = CS_CP1252; + + return charset; +} + /* * Create new pilot file object. * \return Initialized JPilot file object. @@ -1105,14 +1116,9 @@ static void jpilot_parse_label( JPilotFile *pilotFile, gchar *labelEntry, ItemPe addritem_email_set_address( email, node->data ); if (convert_charcode) { gchar *convertBuff = NULL; -#if (PILOT_LINK_MAJOR > 11) - convert_FromPilotChar(CS_INTERNAL, labelEntry, - strlen(labelEntry), &convertBuff); -#else convertBuff = conv_codeset_strdup( labelEntry, - conv_get_locale_charset_str_no_utf8(), + jpilot_get_charset(), CS_INTERNAL ); -#endif if (convertBuff) addritem_email_set_remarks( email, convertBuff ); g_free( convertBuff ); @@ -1210,14 +1216,9 @@ static void jpilot_load_address( if( convert_charcode ) { gchar *nameConv = NULL; -#if (PILOT_LINK_MAJOR > 11) - convert_FromPilotChar(CS_INTERNAL, fullName, - strlen(fullName), &nameConv); -#else nameConv = conv_codeset_strdup( fullName, - conv_get_locale_charset_str_no_utf8(), + jpilot_get_charset(), CS_INTERNAL ); -#endif if (nameConv) strncpy2( fullName, nameConv, FULLNAME_BUFSIZE ); g_free( nameConv ); @@ -1383,14 +1384,9 @@ static gboolean jpilot_setup_labels( JPilotFile *pilotFile ) { if( convert_charcode ) { gchar *convertBuff = NULL; -#if (PILOT_LINK_MAJOR > 11) - convert_FromPilotChar(CS_INTERNAL, labelName, - strlen(labelName), &convertBuff); -#else convertBuff = conv_codeset_strdup( labelName, - conv_get_locale_charset_str_no_utf8(), + jpilot_get_charset(), CS_INTERNAL ); -#endif if (convertBuff) { labelName = convertBuff; } @@ -1429,14 +1425,9 @@ GList *jpilot_load_label( JPilotFile *pilotFile, GList *labelList ) { if( labelName ) { if( convert_charcode ) { gchar *convertBuff = NULL; -#if (PILOT_LINK_MAJOR > 11) - convert_FromPilotChar(CS_INTERNAL, labelName, - strlen(labelName), &convertBuff); -#else convertBuff = conv_codeset_strdup( labelName, - conv_get_locale_charset_str_no_utf8(), + jpilot_get_charset(), CS_INTERNAL ); -#endif if (convertBuff) { labelName = convertBuff; } @@ -1530,14 +1521,9 @@ GList *jpilot_load_custom_label( JPilotFile *pilotFile, GList *labelList ) { if( *labelName != '\0' ) { if( convert_charcode ) { gchar *convertBuff = NULL; -#if (PILOT_LINK_MAJOR > 11) - convert_FromPilotChar(CS_INTERNAL, labelName, - strlen(labelName), &convertBuff); -#else convertBuff = conv_codeset_strdup( labelName, - conv_get_locale_charset_str_no_utf8(), + jpilot_get_charset(), CS_INTERNAL ); -#endif if (convertBuff) { labelName = convertBuff; } @@ -1596,14 +1582,9 @@ static void jpilot_build_category_list( JPilotFile *pilotFile ) { if( convert_charcode ) { gchar *convertBuff = NULL; -#if (PILOT_LINK_MAJOR > 11) - convert_FromPilotChar(CS_INTERNAL, cat->name[i], - strlen(cat->name[i]), &convertBuff); -#else convertBuff = conv_codeset_strdup( cat->name[i], - conv_get_locale_charset_str_no_utf8(), + jpilot_get_charset(), CS_INTERNAL ); -#endif if (convertBuff) { addritem_folder_set_name( folder, convertBuff ); g_free( convertBuff ); -- 2.25.1