[nautilus-sendto/gnome-3-0] evolution: Port to newest e-d-s using GSettings



commit 42ca3421e3f0daff4bceaa7ad9964c0828770df9
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Mar 14 16:08:48 2012 +0100

    evolution: Port to newest e-d-s using GSettings

 configure.in                      |    2 +-
 src/plugins/evolution/evolution.c |   36 ++++++++----------------------------
 2 files changed, 9 insertions(+), 29 deletions(-)
---
diff --git a/configure.in b/configure.in
index 2f3733d..ff1918b 100644
--- a/configure.in
+++ b/configure.in
@@ -128,7 +128,7 @@ for plugin in ${used_plugins}; do
 
 	case ${plugin} in
 		evolution)
-			PKG_CHECK_MODULES(NST_EBOOK, libebook-1.2 >= $EBOOK_REQUIRED,
+			PKG_CHECK_MODULES(NST_EBOOK, libebook-1.2 >= $EBOOK_REQUIRED libedataserverui-3.0,
 					   enable_evolution=yes, enable_evolution=no)
 			if test "${enable_evolution}" != "yes" ; then
 				plugin_error_or_ignore "you need libebook from evolution-data-server to build the Evolution plugin"
diff --git a/src/plugins/evolution/evolution.c b/src/plugins/evolution/evolution.c
index 7feb305..782520e 100644
--- a/src/plugins/evolution/evolution.c
+++ b/src/plugins/evolution/evolution.c
@@ -26,10 +26,9 @@
 #include <e-contact-entry.h>
 #include <glib/gi18n-lib.h>
 #include <string.h>
+#include <libedataserverui/e-client-utils.h>
 #include "nautilus-sendto-plugin.h"
 
-#define GCONF_COMPLETION "/apps/evolution/addressbook"
-#define GCONF_COMPLETION_SOURCES GCONF_COMPLETION "/sources"
 #define DEFAULT_MAILTO "/desktop/gnome/url-handlers/mailto/command"
 
 #define CONTACT_FORMAT "%s <%s>"
@@ -174,31 +173,13 @@ add_sources (EContactEntry *entry)
 {
 	ESourceList *source_list;
 
-	source_list =
-		e_source_list_new_for_gconf_default (GCONF_COMPLETION_SOURCES);
-	e_contact_entry_set_source_list (E_CONTACT_ENTRY (entry),
-					 source_list);
-	g_object_unref (source_list);
-}
-
-static void
-sources_changed_cb (GConfClient *client, guint cnxn_id,
-		GConfEntry *entry, EContactEntry *entry_widget)
-{
-	add_sources (entry_widget);
-}
-
-static void
-setup_source_changes (EContactEntry *entry)
-{
-	GConfClient *gc;
-
-	gc = gconf_client_get_default ();
-	gconf_client_add_dir (gc, GCONF_COMPLETION,
-			GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-	gconf_client_notify_add (gc, GCONF_COMPLETION,
-			(GConfClientNotifyFunc) sources_changed_cb,
-			entry, NULL, NULL);
+	if (e_client_utils_get_sources (&source_list,
+					E_CLIENT_SOURCE_TYPE_CONTACTS,
+					NULL)) {
+		e_contact_entry_set_source_list (E_CONTACT_ENTRY (entry),
+						 source_list);
+		g_object_unref (source_list);
+	}
 }
 
 static
@@ -215,7 +196,6 @@ GtkWidget* get_contacts_widget (NstPlugin *plugin)
 			  G_CALLBACK (error_cb), plugin);
 
 	add_sources (E_CONTACT_ENTRY (entry));
-	setup_source_changes (E_CONTACT_ENTRY (entry));
 
 	return entry;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]