[phonemgr] Port to newest e-d-s using GSettings



commit ed58afc0ffc73a106b1e86db70c2be53f90c3b55
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Mar 14 15:47:43 2012 +0100

    Port to newest e-d-s using GSettings
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672067

 configure.in        |    2 +-
 src/e-phone-entry.c |   37 ++++++++-----------------------------
 2 files changed, 9 insertions(+), 30 deletions(-)
---
diff --git a/configure.in b/configure.in
index 366c4a8..5980684 100644
--- a/configure.in
+++ b/configure.in
@@ -46,7 +46,7 @@ PKG_CHECK_MODULES(LIBGSM, glib-2.0 gobject-2.0 $GNOKII_REQS gthread-2.0 bluez $e
 
 PKG_CHECK_MODULES(PHONEMGR, gtk+-3.0 >= 3.0 glib-2.0 >= 2.31.0
 	libcanberra-gtk3 gconf-2.0
-	$GNOME_BLUETOOTH_REQS $evo_pc_file
+	$GNOME_BLUETOOTH_REQS $evo_pc_file libedataserverui-3.0
 	gmodule-2.0 dbus-glib-1 gnome-icon-theme >= 2.19.1
 )
 
diff --git a/src/e-phone-entry.c b/src/e-phone-entry.c
index f74fc60..31d9e36 100644
--- a/src/e-phone-entry.c
+++ b/src/e-phone-entry.c
@@ -32,11 +32,9 @@
 #include <gtk/gtk.h>
 #include <string.h>
 #include <libedataserver/e-source-list.h>
+#include <libedataserverui/e-client-utils.h>
 #include "e-phone-entry.h"
 
-#define GCONF_COMPLETION "/apps/evolution/addressbook"
-#define GCONF_COMPLETION_SOURCES GCONF_COMPLETION "/sources"
-
 #define CONTACT_FORMAT "%s (%s)"
 
 /* Signals */
@@ -188,31 +186,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 (EPhoneEntry *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 void
@@ -221,7 +201,6 @@ e_phone_entry_init (EPhoneEntry *entry)
 	EContactField fields[] = { E_CONTACT_FULL_NAME, E_CONTACT_NICKNAME, E_CONTACT_ORG, E_CONTACT_PHONE_MOBILE, 0 };
 
 	add_sources (E_CONTACT_ENTRY (entry));
-	setup_source_changes (E_PHONE_ENTRY (entry));
 	e_contact_entry_set_search_fields (E_CONTACT_ENTRY (entry), (const EContactField *)fields);
 	e_contact_entry_set_display_func (E_CONTACT_ENTRY (entry), test_display_func, NULL, NULL);
 	g_signal_connect (G_OBJECT (entry), "contact_selected",



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