]> err.no Git - eweouz/commitdiff
Add support for updating full name and email
authorTollef Fog Heen <tfheen@err.no>
Wed, 29 Oct 2008 16:26:50 +0000 (17:26 +0100)
committerTollef Fog Heen <tfheen@err.no>
Wed, 29 Oct 2008 16:26:50 +0000 (17:26 +0100)
src/eweouz-write-addressbook.c

index aecc3943b12334df2deea034f5b4683479721a96..33bcaff2d431d5e51f95c37cdddbe91168deebfe 100644 (file)
@@ -143,6 +143,12 @@ int main(int argc, char **argv)
                                e_book_get_contacts(book, query, &contacts, &error);
 
                                for (c = contacts; c; c = c->next) {
+                                       if (full_name)
+                                               g_object_set(E_CONTACT(c->data), "full-name", full_name, NULL);
+
+                                       if (nickname)
+                                               g_object_set(E_CONTACT(c->data), "nickname", nickname, NULL);
+
                                        if (emails != NULL) {
                                                gchar **head = emails;
                                                GList *el = NULL;
@@ -152,8 +158,8 @@ int main(int argc, char **argv)
                                                        head++;
                                                }
                                                g_object_set(E_CONTACT(c->data), "email", el, NULL);
-                                               e_book_commit_contact(book, E_CONTACT(c->data), &error);
                                        }
+                                       e_book_commit_contact(book, E_CONTACT(c->data), &error);
                                }
                        }
                }