From: Jim Evins Date: Sun, 27 Nov 2005 05:46:22 +0000 (+0000) Subject: 2005-11-27 Jim Evins X-Git-Tag: glabels-2_3_0~393 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e44d2f82ab2179a7c5003d0efd852345c97e2d40;p=glabels 2005-11-27 Jim Evins * src/merge-evolution.c: (gl_merge_evolution_get_key_list), (gl_merge_evolution_get_primary_key), (gl_merge_evolution_get_record): Don't create "record_key" pseudo-key. Don't populate fields with null data. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@562 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index bd0038b2..61333fdb 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,11 @@ +2005-11-27 Jim Evins + + * src/merge-evolution.c: (gl_merge_evolution_get_key_list), + (gl_merge_evolution_get_primary_key), + (gl_merge_evolution_get_record): + Don't create "record_key" pseudo-key. Don't populate + fields with null data. + 2005-11-25 Jim Evins * src/merge-evolution.c: (gl_merge_evolution_finalize), diff --git a/glabels2/src/merge-evolution.c b/glabels2/src/merge-evolution.c index b48ec3c4..9fc36582 100644 --- a/glabels2/src/merge-evolution.c +++ b/glabels2/src/merge-evolution.c @@ -257,9 +257,6 @@ gl_merge_evolution_get_key_list (glMerge *merge) merge_evolution = GL_MERGE_EVOLUTION (merge); - key_list = NULL; - key_list = g_list_prepend (key_list, g_strdup ("record_key")); - /* for the previously retrieved supported fileds, go through them and find * their pretty names */ for (iter = merge_evolution->private->fields; @@ -283,7 +280,7 @@ gl_merge_evolution_get_key_list (glMerge *merge) static gchar * gl_merge_evolution_get_primary_key (glMerge *merge) { - return g_strdup ("record_key"); + return g_strdup (e_contact_pretty_name(E_CONTACT_FILE_AS)); } /*--------------------------------------------------------------------------*/ @@ -483,24 +480,21 @@ gl_merge_evolution_get_record (glMerge *merge) * into the glMergeRecord structure. When done, free up the resources for * that contact */ - /* get the record key */ - field = g_new0 (glMergeField, 1); - field->key = g_strdup ("record_key"); - field->value = g_strdup (e_contact_get_const(contact, E_CONTACT_FILE_AS)); - - record->field_list = g_list_prepend (record->field_list, field); - /* iterate through the supported fields, and add them to the list */ for (iter = merge_evolution->private->fields; iter != NULL; iter = g_list_next(iter)) { - field = g_new0 (glMergeField, 1); + gchar *value; field_id = *(EContactField *)iter->data; - field->key = g_strdup (e_contact_pretty_name (field_id)); - field->value = g_strdup (e_contact_get_const (contact, field_id)); + value = g_strdup (e_contact_get_const (contact, field_id)); - record->field_list = g_list_prepend (record->field_list, field); + if (value) { + field = g_new0 (glMergeField, 1); + field->key = g_strdup (e_contact_pretty_name (field_id)); + field->value = value; + record->field_list = g_list_prepend (record->field_list, field); + } } record->field_list = g_list_reverse (record->field_list);