]> git.sur5r.net Git - glabels/commitdiff
unbreak with evolution-data-server >= 3.6.0
authorJasper Lievisse Adriaanse <jasper@humppa.nl>
Mon, 1 Apr 2013 08:53:59 +0000 (10:53 +0200)
committerJasper Lievisse Adriaanse <jasper@humppa.nl>
Mon, 1 Apr 2013 08:53:59 +0000 (10:53 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=685130

src/merge-evolution.c
src/merge-vcard.c

index bd1448338f94bc469599340e4952d162dd51add9..c3c2639ff296c37dab92e6941776376d030c0be0 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "merge-evolution.h"
 
-#include <libebook/e-book.h>
+#include <libebook/libebook.h>
 #include <glib/gi18n.h>
 #include <stdio.h>
 #include <string.h>
@@ -297,6 +297,31 @@ static gint sort_contact_by_file_as(gconstpointer *a, gconstpointer *b)
 /*--------------------------------------------------------------------------*/
 /* Open merge source.                                                       */
 /*--------------------------------------------------------------------------*/
+static EBook *
+gl_open_system_addressbook (GError **error)
+{
+   ESourceRegistry *registry;
+   EBook *book = NULL;
+   ESource *source;
+
+   registry = e_source_registry_new_sync (NULL, error);
+   if (!registry)
+       return NULL;
+
+   source = e_source_registry_ref_builtin_address_book (registry);
+   if (!source) {
+       g_object_unref (registry);
+       return NULL;
+   }
+
+   book = e_book_new (source, error);
+
+   g_object_unref (source);
+   g_object_unref (registry);
+
+   return book;
+}
+
 static void
 gl_merge_evolution_open (glMerge *merge)
 {
@@ -317,12 +342,12 @@ gl_merge_evolution_open (glMerge *merge)
                 return;
         }
 
-        merge_evolution->priv->book = e_book_new_system_addressbook(&error);
+        merge_evolution->priv->book = gl_open_system_addressbook(&error);
         if (!merge_evolution->priv->book) {
                 g_warning ("Couldn't open addressbook.");
                 if (error)
                 {
-                        g_warning ("e_book_new_system_addressbook: %s", error->message);
+                        g_warning ("gl_open_system_addressbook: %s", error->message);
                         g_error_free (error);
                 }
                 e_book_query_unref(query);
index da1deff300b7713b2a876fadf009eb8bcf3f53b1..65540151b20c26cf067f1567707a4d66d8d74eee 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "merge-vcard.h"
 
-#include <libebook/e-contact.h>
+#include <libebook/libebook.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>