]> git.sur5r.net Git - glabels/commitdiff
2005-11-27 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Sun, 27 Nov 2005 05:46:22 +0000 (05:46 +0000)
committerJim Evins <evins@snaught.com>
Sun, 27 Nov 2005 05:46:22 +0000 (05:46 +0000)
* 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

glabels2/ChangeLog
glabels2/src/merge-evolution.c

index bd0038b2e50e9dfe90e9144a1de94f1a29671cb5..61333fdbff9990081cc629eb351aec0aa37d155b 100644 (file)
@@ -1,3 +1,11 @@
+2005-11-27  Jim Evins  <evins@snaught.com>
+
+       * 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  <evins@snaught.com>
 
        * src/merge-evolution.c: (gl_merge_evolution_finalize),
index b48ec3c426d465019b989ae08abd12df0b6a2c07..9fc36582fb3eb570b0dcfe59a9adbcf0852d17c9 100644 (file)
@@ -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);