2006-12-19 [colin] 2.6.1cvs55
authorColin Leroy <colin@colino.net>
Tue, 19 Dec 2006 20:02:46 +0000 (20:02 +0000)
committerColin Leroy <colin@colino.net>
Tue, 19 Dec 2006 20:02:46 +0000 (20:02 +0000)
* src/jpilot.c
Same as before, without depending on
pisock >= 0.12

ChangeLog
PATCHSETS
configure.ac
src/jpilot.c

index 0e15a11df221c7d6062431059c20f7e94a87c4ac..c9201eef77f37504ff06b2a27d9abea0f885a5ea 100644 (file)
--- 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
index 790d96ffffd1a4c7b64ac48f703b469d0fadd3db..28bbaa3dc595fd298f25ea4cd024d893ce7f5169 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index 2f405a99672819e740f925637b55d357bab0336d..d9a094e146dc47b942e7f1bf1c117799e0d0e75a 100644 (file)
@@ -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
index 2b80ff10dbb37be979fffc29ee546f41655b10b1..83daba2dab165d8830be0cdd581435aa3c457a27 100644 (file)
 #include <netinet/in.h>
 
 #ifdef HAVE_LIBPISOCK_PI_ARGS_H
-#  include <libpisock/pi-util.h>
 #  include <libpisock/pi-args.h>
 #  include <libpisock/pi-appinfo.h>
 #  include <libpisock/pi-address.h>
 #  include <libpisock/pi-version.h>
 #else
-#  include <pi-util.h>
 #  include <pi-args.h>
 #  include <pi-appinfo.h>
 #  include <pi-address.h>
@@ -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 );