sync with sylpheed 0.6.3cvs9
authorPaul Mangan <paul@claws-mail.org>
Sat, 20 Oct 2001 07:04:54 +0000 (07:04 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sat, 20 Oct 2001 07:04:54 +0000 (07:04 +0000)
14 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/addressbook.c
src/addrindex.h
src/folder.c
src/foldersel.c
src/jpilot.c
src/jpilot.h
src/ldif.c
src/ldif.h
src/syldap.c
src/syldap.h

index ef24cfb..202ada0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,14 @@
        * src/smtp.[ch]: smtp_from(): abort if auth failed.
        * changed C++-style comments into C-style in some files, and
          removed unnecessary commented out codes.
+       * src/addrcache.[ch]
+         src/addressbook.c
+         src/addrindex.[ch]
+         src/jpilot.[ch]
+         src/syldap.[ch]: updated the addressbook code, and fixed the
+         thread bug of LDAP.
+       * src/ldif.[ch]
+         src/importldif.[ch]: new.
 
 2001-10-18
 
index 609c9e7..83bd39e 100644 (file)
@@ -1,6 +1,13 @@
+2001-10-20 [paul]      0.6.3claws28
+
+       * sync with sylpheed 0.6.3cvs9
+               see ChangeLog entry 2001-10-19
+
+       * correct Alfons' last ChangeLog.claws entry
+
 2001-10-19 [alfons]
 
-       * src/gpgtext.[ch]
+       * src/pgptext.[ch]
                fix compilation problems (part of bug #472895)
 
 2001-10-18 [hoa]        0.6.3claws27
index 50c98ad..b1a69b8 100644 (file)
@@ -3,6 +3,14 @@
        * src/smtp.[ch]: smtp_from(): Ç§¾Ú¤Ë¼ºÇÔ¤·¤¿¾ì¹çÃæÃǤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
        * C++ ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¤ò C ¥¹¥¿¥¤¥ë¤ËÊѹ¹¤·¡¢ÉÔÍפʥ³¥á¥ó¥È¥¢¥¦¥È
          ¤µ¤ì¤¿¥³¡¼¥É¤òºï½ü¡£
+       * src/addrcache.[ch]
+         src/addressbook.c
+         src/addrindex.[ch]
+         src/jpilot.[ch]
+         src/syldap.[ch]: ¥¢¥É¥ì¥¹Ä¢¤Î¥³¡¼¥É¤ò¹¹¿·¤·¡¢ LDAP ¤Î¥¹¥ì¥Ã¥É
+         ¤Î¥Ð¥°¤ò½¤Àµ¡£
+       * src/ldif.[ch]
+         src/importldif.[ch]: ¿·µ¬¡£
 
 2001-10-18
 
index c0df2f9..ef8b8ef 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws27
+EXTRA_VERSION=claws28
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index bab65e9..88ccdc1 100644 (file)
@@ -337,7 +337,7 @@ static void addressbook_list_select_clear   (void);
 static void addressbook_list_select_add                (AddressObject *obj);
 static void addressbook_list_select_remove     (AddressObject *obj);
 
-static void addressbook_import_ldif_cb         ();
+static void addressbook_import_ldif_cb         (void);
 
 static GtkItemFactoryEntry addressbook_entries[] =
 {
@@ -363,8 +363,8 @@ static GtkItemFactoryEntry addressbook_entries[] =
        {N_("/_Address/---"),           NULL,           NULL, 0, "<Separator>"},
        {N_("/_Address/_Edit"),         "<alt>Return",  addressbook_edit_address_cb,    0, NULL},
        {N_("/_Address/_Delete"),       NULL,           addressbook_delete_address_cb,  0, NULL},
-       {N_("/_Tools/---"),             NULL,           NULL, 0, "<Separator>"},
-       {N_("/_Tools/Import _LDIF"),    NULL,           addressbook_import_ldif_cb,     0, NULL},
+       {N_("/_Tools"),                 NULL,           NULL, 0, "<Branch>"},
+       {N_("/_Tools/Import _LDIF file"), NULL,         addressbook_import_ldif_cb,     0, NULL},
        {N_("/_Help"),                  NULL,           NULL, 0, "<LastBranch>"},
        {N_("/_Help/_About"),           NULL,           about_show, 0, NULL}
 };
@@ -377,10 +377,9 @@ static GtkItemFactoryEntry addressbook_entries[] =
        {N_("/_Edit/_Paste"),           "<ctl>V",       NULL,                           0, NULL},
        {N_("/_Tools"),                 NULL,           NULL, 0, "<Branch>"},
        {N_("/_Tools/Import _Mozilla"), NULL,           NULL,                           0, NULL},
-       {N_("/_Tools/Import _LDIF"),    NULL,           NULL,                           0, NULL},
        {N_("/_Tools/Import _vCard"),   NULL,           NULL,                           0, NULL},
        {N_("/_Tools/---"),             NULL,           NULL, 0, "<Separator>"},
-       {N_("/_Tools/Export _LDIF"),    NULL,           NULL,                           0, NULL},
+       {N_("/_Tools/Export _LDIF file"), NULL,         NULL,                           0, NULL},
        {N_("/_Tools/Export v_Card"),   NULL,           NULL,                           0, NULL},
 */
 
@@ -3466,28 +3465,24 @@ static void addressbook_import_ldif_cb() {
        GtkCTreeNode *newNode;
 
        adapter = addrbookctl_find_interface( ADDR_IF_BOOK );
-       if( adapter ) {
-               if( adapter->treeNode ) {
-                       abf = addressbook_imp_ldif( _addressIndex_ );
-                       if( abf ) {
-                               ds = addrindex_index_add_datasource( _addressIndex_, ADDR_IF_BOOK, abf );
-                               ads = addressbook_create_ds_adapter( ds, ADDR_BOOK, NULL );
-                               addressbook_ads_set_name( ads, abf->name );
-                               newNode = addressbook_add_object( adapter->treeNode, ADDRESS_OBJECT(ads) );
-                               if( newNode ) {
-                                       gtk_ctree_select( GTK_CTREE(addrbook.ctree), newNode );
-                                       addrbook.treeSelected = newNode;
-                               }
+       if ( !adapter || !adapter->treeNode ) return;
 
-                               /* Notify address completion */
-                               invalidate_address_completion();
-                       }
-               }
+       abf = addressbook_imp_ldif( _addressIndex_ );
+       if ( !abf ) return;
+
+       ds = addrindex_index_add_datasource( _addressIndex_, ADDR_IF_BOOK, abf );
+       ads = addressbook_create_ds_adapter( ds, ADDR_BOOK, NULL );
+       addressbook_ads_set_name( ads, abf->name );
+       newNode = addressbook_add_object( adapter->treeNode, ADDRESS_OBJECT(ads) );
+       if ( newNode ) {
+               gtk_ctree_select( GTK_CTREE(addrbook.ctree), newNode );
+               addrbook.treeSelected = newNode;
        }
 
+       /* Notify address completion */
+       invalidate_address_completion();
 }
 
 /*
 * End of Source.
 */
-
index 64a402e..a31ed8e 100644 (file)
@@ -78,7 +78,7 @@ struct _AddressInterface {
        GList *(*getListPerson)( void * );
        GList *(*getAllPersons)( void * );
        GList *(*getAllGroups)( void * );
-       gchar *(*getName) ( void * );
+       gchar *(*getName)( void * );
        void (*setAccessFlag)( void *, void * );
 };
 
index a3202ee..993de0e 100644 (file)
@@ -1297,7 +1297,7 @@ static void folder_write_list_recursive(GNode *node, gpointer data)
                if (item->ret_rcpt)
                        fputs(" reqretrcpt=\"1\"", fp);
                fprintf(fp,
-                       " mtime=\"%ld\" new=\"%d\" unread=\"%d\" total=\"%d\"",
+                       " mtime=\"%lu\" new=\"%d\" unread=\"%d\" total=\"%d\"",
                        item->mtime, item->new, item->unread, item->total);
        }
 
index 39e1700..23d1476 100644 (file)
@@ -163,12 +163,10 @@ static void foldersel_create(void)
        gtk_ctree_set_indent(GTK_CTREE(ctree), CTREE_INDENT);
        GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(ctree)->column[0].button,
                               GTK_CAN_FOCUS);
-       /*                             
-       gtk_signal_connect(GTK_OBJECT(ctree), "tree_select_row",
-                          GTK_SIGNAL_FUNC(foldersel_selected), NULL);
+       /* gtk_signal_connect(GTK_OBJECT(ctree), "tree_select_row",
+                          GTK_SIGNAL_FUNC(foldersel_selected), NULL); */
        gtk_signal_connect(GTK_OBJECT(ctree), "select_row",
                           GTK_SIGNAL_FUNC(foldersel_selected), NULL);
-       */
 
        entry = gtk_entry_new();
        gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0);
index 78108a6..ee328c0 100644 (file)
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <dlfcn.h>
+#include <netinet/in.h>
 
 #ifdef HAVE_LIBPISOCK_PI_ARGS_H
 #  include <libpisock/pi-args.h>
@@ -138,12 +139,12 @@ typedef struct {
 
 /* Shamelessly copied from JPilot (libplugin.h) */
 typedef struct {
-   unsigned long header_len;
-   unsigned long header_version;
-   unsigned long rec_len;
-   unsigned long unique_id;
-   unsigned long rt; /* Record Type */
-   unsigned char attrib;
+       unsigned long header_len;
+       unsigned long header_version;
+       unsigned long rec_len;
+       unsigned long unique_id;
+       unsigned long rt; /* Record Type */
+       unsigned char attrib;
 } PC3RecordHeader;
 
 /*
@@ -281,9 +282,9 @@ GList *jpilot_get_custom_labels( JPilotFile *pilotFile ) {
 }
 
 /*
- * Return filespec of PC3 file corresponding to JPilot PDB file.
- * Note: Filespec should be g_free() when done.
- */
+* Return filespec of PC3 file corresponding to JPilot PDB file.
+* Note: Filespec should be g_free() when done.
+*/
 static gchar *jpilot_get_pc3_file( JPilotFile *pilotFile ) {
        gchar *fileSpec, *r;
        gint i, len, pos;
@@ -349,7 +350,8 @@ static gboolean jpilot_check_files( JPilotFile *pilotFile ) {
        gchar *pcFile;
 
        /* Check main file */
-       if( addrcache_check_file( pilotFile->addressCache, pilotFile->path ) ) return TRUE;
+       if( addrcache_check_file( pilotFile->addressCache, pilotFile->path ) )
+               return TRUE;
 
        /* Test PC3 file */
        if( ! pilotFile->havePC3 ) return FALSE;
@@ -436,7 +438,7 @@ void jpilot_print_file( JPilotFile *pilotFile, FILE *stream ) {
        addrcache_print( pilotFile->addressCache, stream );
        fprintf( stream, "  ret val: %d\n", pilotFile->retVal );
        fprintf( stream, " have pc3: %s\n", pilotFile->havePC3 ? "yes" : "no" );
-       fprintf( stream, " pc3 time: %d\n", pilotFile->pc3ModifyTime );
+       fprintf( stream, " pc3 time: %lu\n", pilotFile->pc3ModifyTime );
        addritem_print_item_folder( pilotFile->addressCache->rootFolder, stream );
 }
 
@@ -464,7 +466,7 @@ void jpilot_print_short( JPilotFile *pilotFile, FILE *stream ) {
        }
        addrcache_print( pilotFile->addressCache, stream );
        fprintf( stream, " have pc3: %s\n", pilotFile->havePC3 ? "yes" : "no" );
-       fprintf( stream, " pc3 time: %d\n", pilotFile->pc3ModifyTime );
+       fprintf( stream, " pc3 time: %lu\n", pilotFile->pc3ModifyTime );
 }
 
 /* Shamelessly copied from JPilot (libplugin.c) */
@@ -724,7 +726,7 @@ static int read_header(FILE *pc_in, PC3RecordHeader *header) {
        num = fread(&l, sizeof(l), 1, pc_in);
        if (feof(pc_in)) {
                return -1;
-       }      
+       }
        if (num!=1) {
                return num;
        }
@@ -736,7 +738,7 @@ static int read_header(FILE *pc_in, PC3RecordHeader *header) {
        num = fread(packed_header+sizeof(l), len-sizeof(l), 1, pc_in);
        if (feof(pc_in)) {
                return -1;
-       }      
+       }
        if (num!=1) {
                return num;
        }
@@ -750,17 +752,17 @@ static gint jpilot_read_next_pc( FILE *in, buf_rec *br ) {
        PC3RecordHeader header;
        int rec_len, num;
        char *record;
-   
+
        if(feof(in)) {
-               return MGU_EOF;
+               return MGU_EOF;
        }
        num = read_header(in, &header);
        if (num < 1) {
                if (ferror(in)) {
-                       return MGU_ERROR_READ;
+                       return MGU_ERROR_READ;
                }
                if (feof(in)) {
-                       return MGU_EOF;
+                       return MGU_EOF;
                }
        }
        rec_len = header.rec_len;
@@ -772,7 +774,7 @@ static gint jpilot_read_next_pc( FILE *in, buf_rec *br ) {
        if (num != 1) {
                if (ferror(in)) {
                        free(record);
-                       return MGU_ERROR_READ;
+                       return MGU_ERROR_READ;
                }
        }
        br->rt = header.rt;
@@ -810,12 +812,12 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
        recs_returned = 0;
 
        if( pilotFile->path == NULL ) {
-               return MGU_BAD_ARGS;
+               return MGU_BAD_ARGS;
        }
-       
+
        in = fopen( pilotFile->path, "r" );
        if (!in) {
-               return MGU_OPEN_FILE;
+               return MGU_OPEN_FILE;
        }
 
        /* Read the database header */
@@ -835,8 +837,8 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
        num_records = dbh.number_of_records;
        out_of_order = 0;
        prev_offset = 0;
-   
-       for (i=1; i<num_records+1; i++) {
+
+       for (i = 1; i < num_records + 1; i++) {
                num = fread(&rh, sizeof(record_header), 1, in);
                if (num != 1) {
                        if (ferror(in)) {
@@ -920,7 +922,7 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
                        temp_br->size = rec_size;
 
                        *records = g_list_append(*records, temp_br);
-        
+
                        recs_returned++;
                }
        }
@@ -933,7 +935,7 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
        pc_in = fopen( pcFile, "r");
        g_free( pcFile );
 
-       if( pc_in==NULL ) {
+       if( pc_in == NULL ) {
                return MGU_SUCCESS;
        }
 
@@ -973,8 +975,8 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
        return MGU_SUCCESS;
 }
 
-#define        FULLNAME_BUFSIZE   256
-#define        EMAIL_BUFSIZE      256
+#define FULLNAME_BUFSIZE       256
+#define EMAIL_BUFSIZE          256
 /*
  * Unpack address, building new data inside cache.
  */
@@ -1001,7 +1003,7 @@ static void jpilot_load_address( JPilotFile *pilotFile, buf_rec *buf, ItemFolder
                addrEnt = addr.entry;
                attrib = buf->attrib;
                unique_id = buf->unique_id;
-               cat_id = attrib & 0x0F;
+               cat_id = attrib & 0x0F;
 
                *fullName = *bufEMail = '\0';
                if( addrEnt[ IND_LABEL_FIRSTNAME ] ) {
@@ -1048,8 +1050,8 @@ static void jpilot_load_address( JPilotFile *pilotFile, buf_rec *buf, ItemFolder
                                        email = addritem_create_item_email();
                                        addritem_email_set_address( email, bufEMail );
                                        addrcache_id_email( pilotFile->addressCache, email );
-                                       addrcache_person_add_email(
-                                               pilotFile->addressCache, person, email );
+                                       addrcache_person_add_email
+                                               pilotFile->addressCache, person, email );
                                }
                        }
                }
@@ -1074,10 +1076,9 @@ static void jpilot_load_address( JPilotFile *pilotFile, buf_rec *buf, ItemFolder
                                        addritem_email_set_address( email, bufEMail );
                                        addritem_email_set_remarks( email, ai->labels[ind] );
                                        addrcache_id_email( pilotFile->addressCache, email );
-                                       addrcache_person_add_email(
-                                               pilotFile->addressCache, person, email );
+                                       addrcache_person_add_email
+                                               pilotFile->addressCache, person, email );
                                }
-
                        }
 
                        node = g_list_next( node );
@@ -1086,15 +1087,13 @@ static void jpilot_load_address( JPilotFile *pilotFile, buf_rec *buf, ItemFolder
                if( person->listEMail ) {
                        if( cat_id > -1 && cat_id < JPILOT_NUM_CATEG ) {
                                /* Add to specified category */
-                               addrcache_folder_add_person(
-                                       pilotFile->addressCache, folderInd[cat_id], person );
-                       }
-                       else {
+                               addrcache_folder_add_person
+                                       ( pilotFile->addressCache, folderInd[cat_id], person );
+                       } else {
                                /* Add to root folder */
                                addrcache_add_person( pilotFile->addressCache, person );
                        }
-               }
-               else {
+               } else {
                        addritem_free_item_person( person );
                        person = NULL;
                }
@@ -1195,9 +1194,6 @@ static gint jpilot_read_metadata( JPilotFile *pilotFile ) {
                free(buf);
        }
        if( num <= 0 ) {
-               /*
-               fprintf( stderr, "error reading '%s'\n", pilotFile->path );
-               */
                pilotFile->retVal = MGU_ERROR_READ;
                return pilotFile->retVal;
        }
index a6829d2..e1a9fae 100644 (file)
@@ -63,11 +63,12 @@ struct _JPilotFile {
 
 /* Limits */
 #define JPILOT_NUM_LABELS      22      /* Number of labels */
-#define JPILOT_NUM_PHONELABELS  8      /* Number of phone number labels */
+#define JPILOT_NUM_PHONELABELS       /* Number of phone number labels */
 #define JPILOT_NUM_CATEG       16      /* Number of categories */
 #define JPILOT_LEN_LABEL       15      /* Max length of label */
 #define JPILOT_LEN_CATEG       15      /* Max length of category */
-#define JPILOT_NUM_ADDR_PHONE   5      /* Number of phone entries a person can have */
+#define JPILOT_NUM_ADDR_PHONE  5       /* Number of phone entries a person
+                                          can have */
 
 /* Function prototypes */
 JPilotFile *jpilot_create              ( void );
@@ -113,4 +114,3 @@ gint jpilot_read_modified           ( JPilotFile *pilotFile );
 #endif /* USE_JPILOT */
 
 #endif /* __JPILOT_H__ */
-
index 69cb709..056159f 100644 (file)
@@ -347,6 +347,7 @@ static void ldif_clear_rec( Ldif_ParsedRec *rec ) {
        rec->listID = NULL;
 }
 
+#if 0
 static void ldif_print_record( Ldif_ParsedRec *rec, FILE *stream ) {
        fprintf( stdout, "LDIF Parsed Record:\n" );
        fprintf( stdout, "common name:" );
@@ -368,6 +369,7 @@ static void ldif_print_record( Ldif_ParsedRec *rec, FILE *stream ) {
        mgu_print_list( rec->listID, stdout );
        if( ! rec->listID ) fprintf( stdout, "\n" );
 }
+#endif
 
 /*
 * Read file data into address cache.
@@ -454,14 +456,14 @@ static void ldif_read_file( LdifFile *ldifFile, AddressCache *cache ) {
 
 }
 
-// ============================================================================================
 /*
+* ============================================================================================
 * Read file into list. Main entry point
 * Enter:  ldifFile LDIF control data.
 *         cache    Address cache to load.
 * Return: Status code.
+* ============================================================================================
 */
-// ============================================================================================
 gint ldif_import_data( LdifFile *ldifFile, AddressCache *cache ) {
        g_return_val_if_fail( ldifFile != NULL, MGU_BAD_ARGS );
        ldifFile->retVal = MGU_SUCCESS;
index 5325dbe..71c1350 100644 (file)
@@ -79,7 +79,7 @@ struct _LdifFile {
        gchar        *path;
        gchar        *bufptr;
        gchar        buffer[ LDIFBUFSIZE ];
-       // AddressCache *addressCache;
+       /* AddressCache *addressCache; */
        gint         retVal;
 };
 
index 2c496a6..c8f7a8b 100644 (file)
@@ -28,6 +28,8 @@
 #ifdef USE_LDAP
 
 #include <glib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtkmain.h>
 #include <sys/time.h>
 #include <string.h>
 #include <ldap.h>
@@ -234,6 +236,7 @@ void syldap_free( SyldapServer *ldapServer ) {
        g_free( ldapServer->bindPass );
        g_free( ldapServer->searchCriteria );
        g_free( ldapServer->searchValue );
+       g_free( ldapServer->thread );
 
        ldapServer->port = 0;
        ldapServer->entriesRead = 0;
@@ -253,7 +256,6 @@ void syldap_free( SyldapServer *ldapServer ) {
        ldapServer->searchCriteria = NULL;
        ldapServer->searchValue = NULL;
        ldapServer->addressCache = NULL;
-       g_free(ldapServer->thread);
        ldapServer->thread = NULL;
        ldapServer->busyFlag = FALSE;
        ldapServer->retVal = MGU_SUCCESS;
@@ -635,11 +637,11 @@ gint syldap_search( SyldapServer *ldapServer ) {
  * main thread (the thread running the GTK event loop). */
 static gint syldap_display_search_results(SyldapServer *ldapServer)
 {
-       /* NOTE: when this function is called the accompanying thread should 
+       /* NOTE: when this function is called the accompanying thread should
         * already be terminated. */
        gtk_idle_remove(ldapServer->idleId);
        ldapServer->callBack(ldapServer);
-       /* FIXME:  match should know whether to free this SyldapServer stuff.  */
+       /* FIXME:  match should know whether to free this SyldapServer stuff. */
        g_free(ldapServer->thread);
        ldapServer->thread = NULL;
        return TRUE;
@@ -675,7 +677,6 @@ gint syldap_read_data( SyldapServer *ldapServer ) {
                gdk_threads_enter();
                ldapServer->idleId = gtk_idle_add(syldap_display_search_results, ldapServer);
                gdk_threads_leave();
-       
        }
 
        return ldapServer->retVal;
@@ -712,7 +713,7 @@ gint syldap_read_data_th( SyldapServer *ldapServer ) {
        ldapServer->busyFlag = FALSE;
        syldap_check_search( ldapServer );
        if( ldapServer->retVal == MGU_SUCCESS ) {
-//             debug_print("Staring LDAP read thread\n");
+               /* debug_print("Staring LDAP read thread\n"); */
 
                ldapServer->busyFlag = TRUE;
                ldapServer->thread = g_new0(pthread_t, 1);
index c6e9d49..a4c58eb 100644 (file)
@@ -65,7 +65,7 @@ struct _SyldapServer {
        pthread_t    *thread;
        gboolean     busyFlag;
        void         (*callBack)( void * );
-       guint        idleId;
+       guint        idleId;
 };
 
 /* Function prototypes */
@@ -109,4 +109,3 @@ gboolean syldap_test_ldap_lib       ( void );
 #endif /* USE_LDAP */
 
 #endif /* __SYLDAP_H__ */
-