]> err.no Git - eweouz/commitdiff
Merge branch 'master' of git+ssh://git.err.no/srv/git.err.no/www/eweouz 0.2
authorTollef Fog Heen <tfheen@err.no>
Tue, 2 Sep 2008 21:48:01 +0000 (23:48 +0200)
committerTollef Fog Heen <tfheen@err.no>
Tue, 2 Sep 2008 21:48:01 +0000 (23:48 +0200)
README
debian/changelog
lisp/eweouz.el
src/eweouz-dump-addressbook.c
src/eweouz-write-addressbook.c

diff --git a/README b/README
index 5fc2968aebf6a1068f8b4fd2bb03ab5203ba111b..6005b57ad7519c4400b09a7a6414b76caa49ed25 100644 (file)
--- a/README
+++ b/README
@@ -25,6 +25,8 @@ instead.
   address book
 
 Feature suggestions, patches and general feedback is of course
-welcome.
+welcome.  Patches in the form of a git branch against any of the ones
+found on git://git.err.no/eweouz is preferred, but others are of
+course also accepted.
 
  -- Tollef Fog Heen <tfheen@err.no>
index ced907edf8337119c7befc04447e2f07602ef5fe..d73cd34b63eb92ae98446e00143705f686003af8 100644 (file)
@@ -1,3 +1,9 @@
+eweouz (0.2) unstable; urgency=low
+
+  * New upstream release
+
+ -- Tollef Fog Heen <tfheen@ubuntu.com>  Fri, 08 Aug 2008 16:20:41 +0200
+
 eweouz (0.1) unstable; urgency=low
 
   * Initial Release.
index 8ae3f8746d801b65177fb8ca81b33e840d5aec49..91e24cd363e0a27f442bb7e8626981403e4580c1 100644 (file)
 (defun eweouz-add-sender ()
   "Add sender of current message"
   (interactive)
-
   (save-excursion
     (set-buffer gnus-article-buffer)
-    (let* ((from (mail-header-parse-address (gnus-fetch-field "From")))
-          (record (list (cons 'email (car from))
-                        (cons 'name (cdr from)))))
-      (eweouz-do-add record))))
+    (eweouz-do-add (mail-header-parse-address (gnus-fetch-field "From")))))
 
 (defun eweouz-do-add (record)
   (interactive)
-  (let* ((name (cdr (assoc 'name record)))
-        (email (cdr (assoc 'email record))))
+  (let* ((email (car record))
+        (name (cdr record)))
+    (message (format "%s" record))
     (call-process eweouz-write-path nil nil nil "--id" "new" "--full-name" name
                  "--emails" email)))
 
index ca07d2170b540f045508807801ce48c4bd16d0d3..237b2dcc26e1f4788b5c9aba143b8ceeb1cf79b0 100644 (file)
@@ -76,12 +76,14 @@ int main(int argc, char **argv)
 
        if (error != NULL) {
                fprintf(stderr, "%s\n", error->message);
+               return 1;
        }
 
        e_book_get_addressbooks(&source_list, &error);
 
        if (error != NULL) {
                fprintf(stderr, "%s\n", error->message);
+               return 1;
        }
 
        if (search_filter != NULL) {
@@ -99,8 +101,25 @@ int main(int argc, char **argv)
                for (s = sources ; s; s = s->next) {
                        source = E_SOURCE(s->data);
                        book = e_book_new(source, &error);
+
+                       if (error != NULL) {
+                         fprintf(stderr, "%s\n", error->message);
+                         return 1;
+                       }
+
                        e_book_open(book, TRUE, &error);
+
+
+                       if (error != NULL) {
+                         fprintf(stderr, "%s\n", error->message);
+                         return 1;
+                       }
+
                        e_book_get_contacts(book, query, &contacts, &error);
+                       if (error != NULL) {
+                         fprintf(stderr, "%s\n", error->message);
+                         return 1;
+                       }
 
                        for (c = contacts; c; c = c->next) {
                                dump_as_vcard(E_CONTACT(c->data), 1);
index 53cb2a9f340b5cba845a1d4c0731f2d69e02f221..3f57c94bf32e2443eaa750c5d1e934e23b59951a 100644 (file)
@@ -2,7 +2,7 @@
 #include <libedataserver/e-source-group.h>
 #include <gconf/gconf.h>
 #include <glib.h>
-
+#include <locale.h>
 
 static gchar *id = NULL;
 static gchar *full_name = NULL;
@@ -48,18 +48,22 @@ int main(int argc, char **argv)
        GError *error = NULL;
        GOptionContext *optioncontext;
 
+       setlocale (LC_ALL, "");
+
        optioncontext = g_option_context_new ("- whack address book");
        g_option_context_add_main_entries (optioncontext, entries, NULL);
        g_option_context_parse (optioncontext, &argc, &argv, &error);
 
        if (error != NULL) {
                fprintf(stderr, "%s\n", error->message);
+               exit(1);
        }
 
        e_book_get_addressbooks(&source_list, &error);
 
        if (error != NULL) {
                fprintf(stderr, "%s\n", error->message);
+               exit(1);
        }
 
        if (id == NULL) {