[evolution/account-mgmt: 5/33] Adapt libeutil to the new ESource API.



commit 430191ee3b51bc3ee67692b195b815bd224f0f36
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Dec 7 15:30:15 2010 -0600

    Adapt libeutil to the new ESource API.

 doc/reference/shell/tmpl/e-util.sgml |    4 +-
 e-util/Makefile.am                   |    2 -
 e-util/e-marshal.list                |    1 +
 e-util/e-plugin-util.c               |  464 ----------------------------------
 e-util/e-plugin-util.h               |   46 ----
 e-util/e-util.c                      |   46 +---
 e-util/e-util.h                      |   10 +-
 7 files changed, 16 insertions(+), 557 deletions(-)
---
diff --git a/doc/reference/shell/tmpl/e-util.sgml b/doc/reference/shell/tmpl/e-util.sgml
index 060ec3f..0001f4e 100644
--- a/doc/reference/shell/tmpl/e-util.sgml
+++ b/doc/reference/shell/tmpl/e-util.sgml
@@ -391,7 +391,7 @@ Miscellaneous Utilities
 @binding: 
 @source_value: 
 @target_value: 
- source_list: 
+ registry: 
 @Returns: 
 
 
@@ -403,7 +403,7 @@ Miscellaneous Utilities
 @binding: 
 @source_value: 
 @target_value: 
- source_list: 
+ registry: 
 @Returns: 
 
 
diff --git a/e-util/Makefile.am b/e-util/Makefile.am
index a92f615..d882b96 100644
--- a/e-util/Makefile.am
+++ b/e-util/Makefile.am
@@ -43,7 +43,6 @@ eutilinclude_HEADERS = 				\
 	e-print.h				\
 	e-plugin.h				\
 	e-plugin-ui.h				\
-	e-plugin-util.h				\
 	e-profile-event.h			\
 	e-selection.h				\
 	e-signature.h				\
@@ -118,7 +117,6 @@ libeutil_la_SOURCES =				\
 	e-poolv.c				\
 	e-plugin.c				\
 	e-plugin-ui.c				\
-	e-plugin-util.c				\
 	e-print.c				\
 	e-profile-event.c			\
 	e-selection.c				\
diff --git a/e-util/e-marshal.list b/e-util/e-marshal.list
index d4e6f43..d9c708c 100644
--- a/e-util/e-marshal.list
+++ b/e-util/e-marshal.list
@@ -6,6 +6,7 @@ BOOLEAN:INT,INT,OBJECT,INT,INT,UINT
 BOOLEAN:INT,POINTER,INT,BOXED
 BOOLEAN:INT,POINTER,INT,OBJECT,INT,INT,UINT
 BOOLEAN:NONE
+BOOLEAN:OBJECT
 BOOLEAN:OBJECT,DOUBLE,DOUBLE,BOOLEAN
 BOOLEAN:POINTER
 BOOLEAN:POINTER,BOOLEAN,POINTER
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 8f91558..89da937 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -51,7 +51,6 @@
 #include <camel/camel.h>
 #include <libedataserver/e-data-server-util.h>
 #include <libedataserver/e-categories.h>
-#include <libedataserver/e-source-list.h>
 
 #include "filter/e-filter-option.h"
 
@@ -1502,31 +1501,6 @@ e_util_get_searchable_categories (void)
 }
 
 /**
- * e_util_set_source_combo_box_list:
- * @source_combo_box: an #ESourceComboBox
- * @source_gconf_path: GConf path with sources to use in an #ESourceList
- *
- * Sets an #ESourceList of a given GConf path to an #ESourceComboBox.
- **/
-void
-e_util_set_source_combo_box_list (GtkWidget *source_combo_box,
-                                  const gchar *source_gconf_path)
-{
-	ESourceList *source_list;
-	GConfClient *gconf_client;
-
-	g_return_if_fail (source_combo_box != NULL);
-	g_return_if_fail (source_gconf_path != NULL);
-
-	gconf_client = gconf_client_get_default ();
-	source_list = e_source_list_new_for_gconf (
-		gconf_client, source_gconf_path);
-	g_object_set (source_combo_box, "source-list", source_list, NULL);
-	g_object_unref (source_list);
-	g_object_unref (gconf_client);
-}
-
-/**
  * e_binding_transform_color_to_string:
  * @binding: a #GBinding
  * @source_value: a #GValue of type #GDK_TYPE_COLOR
@@ -1667,7 +1641,7 @@ e_binding_transform_enum_nick_to_value (GBinding *binding,
  * @binding: a #GBinding
  * @source_value: a #GValue of type #E_TYPE_SOURCE
  * @target_value: a #GValue of type #G_TYPE_STRING
- * @source_list: an #ESourceList
+ * @registry: an #ESourceRegistry
  *
  * Transforms an #ESource object to its UID string.
  *
@@ -1677,18 +1651,18 @@ gboolean
 e_binding_transform_source_to_uid (GBinding *binding,
                                    const GValue *source_value,
                                    GValue *target_value,
-                                   ESourceList *source_list)
+                                   ESourceRegistry *registry)
 {
 	ESource *source;
 	const gchar *string;
 	gboolean success = FALSE;
 
 	g_return_val_if_fail (G_IS_BINDING (binding), FALSE);
-	g_return_val_if_fail (E_IS_SOURCE_LIST (source_list), FALSE);
+	g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), FALSE);
 
 	source = g_value_get_object (source_value);
 	if (E_IS_SOURCE (source)) {
-		string = e_source_peek_uid (source);
+		string = e_source_get_uid (source);
 		g_value_set_string (target_value, string);
 		success = TRUE;
 	}
@@ -1701,32 +1675,32 @@ e_binding_transform_source_to_uid (GBinding *binding,
  * @binding: a #GBinding
  * @source_value: a #GValue of type #G_TYPE_STRING
  * @target_value: a #GValue of type #E_TYPE_SOURCe
- * @source_list: an #ESourceList
+ * @registry: an #ESourceRegistry
  *
  * Transforms an #ESource UID string to the corresponding #ESource object
- * in @source_list.
+ * in @registry.
  *
- * Returns: %TRUE if @source_list had an #ESource object with a matching
+ * Returns: %TRUE if @registry had an #ESource object with a matching
  *          UID string
  **/
 gboolean
 e_binding_transform_uid_to_source (GBinding *binding,
                                    const GValue *source_value,
                                    GValue *target_value,
-                                   ESourceList *source_list)
+                                   ESourceRegistry *registry)
 {
 	ESource *source;
 	const gchar *string;
 	gboolean success = FALSE;
 
 	g_return_val_if_fail (G_IS_BINDING (binding), FALSE);
-	g_return_val_if_fail (E_IS_SOURCE_LIST (source_list), FALSE);
+	g_return_val_if_fail (E_IS_SOURCE_REGISTRY (registry), FALSE);
 
 	string = g_value_get_string (source_value);
 	if (string == NULL || *string == '\0')
 		return FALSE;
 
-	source = e_source_list_peek_source_by_uid (source_list, string);
+	source = e_source_registry_lookup_by_uid (registry, string);
 	if (source != NULL) {
 		g_value_set_object (target_value, source);
 		success = TRUE;
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 554c930..a2ac6de 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -31,7 +31,7 @@
 #include <e-util/e-marshal.h>
 #include <e-util/e-util-enums.h>
 
-#include <libedataserver/e-source-list.h>
+#include <libedataserver/e-source-registry.h>
 
 /* e_get_user_data_dir() used to live here, so #include its new home
  * for backward-compatibility (not that we really care about that). */
@@ -142,10 +142,6 @@ GSList *	e_util_get_category_filter_options
 						(void);
 GList *		e_util_get_searchable_categories (void);
 
-void		e_util_set_source_combo_box_list
-						(GtkWidget *source_combo_box,
-						 const gchar *source_gconf_path);
-
 /* Useful GBinding transformation functions */
 gboolean	e_binding_transform_color_to_string
 						(GBinding *binding,
@@ -171,12 +167,12 @@ gboolean	e_binding_transform_source_to_uid
 						(GBinding *binding,
 						 const GValue *source_value,
 						 GValue *target_value,
-						 ESourceList *source_list);
+						 ESourceRegistry *registry);
 gboolean	e_binding_transform_uid_to_source
 						(GBinding *binding,
 						 const GValue *source_value,
 						 GValue *target_value,
-						 ESourceList *source_list);
+						 ESourceRegistry *registry);
 
 G_END_DECLS
 



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