]> err.no Git - eweouz/commitdiff
Make it possible to add emails to a contact
authorTollef Fog Heen <tfheen@err.no>
Wed, 29 Oct 2008 16:27:39 +0000 (17:27 +0100)
committerTollef Fog Heen <tfheen@err.no>
Wed, 29 Oct 2008 16:27:39 +0000 (17:27 +0100)
Make passing --emails= delete the list of emails, otherwise append to
the list of emails.

src/eweouz-write-addressbook.c

index 33bcaff2d431d5e51f95c37cdddbe91168deebfe..45be78e1c4c57c44d9401ed362f11056cfb4ed5a 100644 (file)
@@ -152,6 +152,14 @@ int main(int argc, char **argv)
                                        if (emails != NULL) {
                                                gchar **head = emails;
                                                GList *el = NULL;
+
+                                               if (*head[0] == '\0') {
+                                                       printf("removing all emails\n");
+                                                       head++;
+                                               } else {
+                                                       g_object_get(E_CONTACT(c->data), "email", &el, NULL);
+                                               }
+
                                                while (*head != NULL) {
                                                        printf("appending %s\n", *head);
                                                        el = g_list_prepend(el, *head);