while( line ) {
listQP = g_slist_append( listQP, line );
len = strlen( line ) - 1;
- if( len > 0 ) {
- if( line[ len ] != '=' ) break;
- line[ len ] = '\0';
- }
+ if( line[ len ] != '=' ) break;
+ line[ len ] = '\0';
line = vcard_get_line( cardFile );
}
return value;
}
-/*
-* Dump linked lists of character strings (for debug).
-*/
-static void vcard_dump_lists( GSList *listName, GSList *listAddr, GSList *listRem, GSList *listID, FILE *stream ) {
- fprintf( stream, "dump name\n" );
- fprintf( stream, "------------\n" );
- mgu_print_list( listName, stdout );
- fprintf( stream, "dump address\n" );
- fprintf( stream, "------------\n" );
- mgu_print_list( listAddr, stdout );
- fprintf( stream, "dump remarks\n" );
- fprintf( stdout, "------------\n" );
- mgu_print_list( listRem, stdout );
- fprintf( stream, "dump id\n" );
- fprintf( stdout, "------------\n" );
- mgu_print_list( listID, stdout );
-}
-
/*
* Build an address list entry and append to list of address items.
*/
-static void vcard_build_items( VCardFile *cardFile, GSList *listName, GSList *listAddr, GSList *listRem,
- GSList *listID )
+static void vcard_build_items(
+ VCardFile *cardFile, GSList *listName, GSList *listAddr,
+ GSList *listRem, GSList *listID )
{
GSList *nodeName = listName;
GSList *nodeID = listID;
if( nodeRemarks ) {
if( str ) {
if( g_strcasecmp( str, "internet" ) != 0 ) {
- if( *str != '\0' ) addritem_email_set_remarks( email, str );
+ if( *str != '\0' )
+ addritem_email_set_remarks( email, str );
}
}
}
if( person->listEMail ) {
addrcache_id_person( cardFile->addressCache, person );
addrcache_add_person( cardFile->addressCache, person );
+ if( nodeID ) {
+ str = nodeID->data;
+ addritem_person_set_external_id( person, str );
+ }
}
else {
addritem_free_item_person( person );
}
- if( nodeID ) {
- str = nodeID->data;
- addritem_person_set_external_id( person, str );
- }
nodeName = g_slist_next( nodeName );
nodeID = g_slist_next( nodeID );
}
* be g_free() when done.
*/
gchar *vcard_find_gnomecard( void ) {
- gchar *homedir;
+ const gchar *homedir;
gchar buf[ WORK_BUFLEN ];
gchar str[ WORK_BUFLEN ];
gchar *fileSpec;