[evolution-patches] Remove libgnomeui from libedataserverui



Hi,

The attached patch tests-no-libgnomeui.diff removes libgnome/bonobo
functions from the test programs in libedataserverui, as they are not
needed.  Trivial patch.


The patch test-no-libgnomeui2.diff removes libgnome/popt code and
replaces it with GOption from GLib 2.6.  Not so trivial as currently EDS
only depends on GLib 2.4.

Thanks,
Ross
Index: libedataserverui/test-contact-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/test-contact-store.c,v
retrieving revision 1.1
diff -u -r1.1 test-contact-store.c
--- libedataserverui/test-contact-store.c	10 Dec 2004 02:58:08 -0000	1.1
+++ libedataserverui/test-contact-store.c	21 Apr 2005 11:55:11 -0000
@@ -27,7 +27,6 @@
 
 #include "e-contact-store.h"
 #include <gtk/gtk.h>
-#include <libgnomeui/gnome-ui-init.h>
 
 static void
 entry_changed (GtkWidget *entry, EContactStore *contact_store)
@@ -66,7 +65,6 @@
 	GtkTreeModel *model_sort;
 	GtkWidget *scrolled_window;
 	GtkWidget *window;
-	GtkWidget *select_names_entry;
 	GtkWidget *tree_view;
 	GtkWidget *box;
 	GtkWidget *entry;
@@ -120,15 +118,9 @@
 int
 main (int argc, char **argv)
 {
-	GnomeProgram *program;
 	const char *gconf_path;
 
-	program = gnome_program_init ("test-source-selector", "0.0",
-				      LIBGNOMEUI_MODULE, argc, argv,
-				      NULL);
-
-	if (bonobo_init (&argc, argv) == FALSE)
-		g_error ("Could not initialize Bonobo.");
+	gtk_init (&argc, &argv);
 
 	if (argc < 2)
 		gconf_path = "/apps/evolution/addressbook/sources";
@@ -137,7 +129,7 @@
 
 	g_idle_add ((GSourceFunc) start_test, (void *) gconf_path);
 
-	bonobo_main ();
+	gtk_main ();
 
 	return 0;
 }
Index: libedataserverui/test-name-selector.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/test-name-selector.c,v
retrieving revision 1.5
diff -u -r1.5 test-name-selector.c
--- libedataserverui/test-name-selector.c	20 Dec 2004 15:31:29 -0000	1.5
+++ libedataserverui/test-name-selector.c	21 Apr 2005 11:55:11 -0000
@@ -29,8 +29,6 @@
 #include "e-name-selector-dialog.h"
 #include "e-name-selector-entry.h"
 #include <gtk/gtk.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <bonobo/bonobo-main.h>
 #include <camel/camel.h>
 
 static void
@@ -39,7 +37,7 @@
 	GtkWidget *dialog = data;
 	
 	gtk_widget_destroy (dialog);
-	bonobo_main_quit ();
+	gtk_main_quit ();
 }
 
 static gboolean
@@ -79,20 +77,14 @@
 int
 main (int argc, char **argv)
 {
-	GnomeProgram *program;
-
-	program = gnome_program_init ("test-name-selector", "0.0",
-				      LIBGNOMEUI_MODULE, argc, argv,
-				      NULL);
-
-	if (bonobo_init (&argc, argv) == FALSE)
-		g_error ("Could not initialize Bonobo.");
+	gtk_init (&argc, &argv);
+	g_thread_init (NULL);
 
 	camel_init (NULL, 0);
 
 	g_idle_add ((GSourceFunc) start_test, NULL);
 
-	bonobo_main ();
+	gtk_main ();
 
 	return 0;
 }
Index: libedataserver/test-source-list.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserver/test-source-list.c,v
retrieving revision 1.5
diff -u -r1.5 test-source-list.c
--- libedataserver/test-source-list.c	27 Nov 2003 06:17:02 -0000	1.5
+++ libedataserver/test-source-list.c	21 Apr 2005 11:57:18 -0000
@@ -25,8 +25,6 @@
 #endif
 
 #include <glib.h>
-#include <libgnome/gnome-program.h>
-#include <libgnome/gnome-init.h>
 #include "e-source-list.h"
 
 /* Globals. */
@@ -56,47 +54,27 @@
 static gboolean unset_value = FALSE;
 static gboolean unset_color = FALSE;
 
-static struct poptOption options[] = {
-	{ "key", '\0', POPT_ARG_STRING, &key_arg, 0,
-	  "Name of the GConf key to use", "PATH" },
-	{ "source", '\0', POPT_ARG_STRING, &source_arg, 0, 
-	  "UID of source to apply operation to", "UID" },
-	{ "group", '\0', POPT_ARG_STRING, &group_arg, 0, 
-	  "UID of group to apply operation to", "UID" },
-	{ "add-group", '\0', POPT_ARG_STRING, &add_group_arg, 0,
-	  "Add group of specified name", "NAME" },
-	{ "add-source", '\0', POPT_ARG_STRING, &add_source_arg, 0,
-	  "Add source of specified name", "NAME" },
-	{ "remove-group", '\0', POPT_ARG_STRING, &remove_group_arg, 0,
-	  "Remove group of specified name", "NAME" },
-	{ "remove-source", '\0', POPT_ARG_STRING, &remove_source_arg, 0,
-	  "Remove source of specified name", "NAME" },
-	{ "property", '\0', POPT_ARG_STRING, &property_arg, 0,
-	  "Name of source property to apply operation to", "PROPERTY" },
-	{ "set-name", '\0', POPT_ARG_STRING, &set_name_arg, 0,
-	  "Set name of source or group.  When used with --group, it sets the name of a group.  "
-	  "When used with both --group and --source, it sets the name of a source.", "NAME" },
-	{ "set-relative-uri", '\0', POPT_ARG_STRING, &set_relative_uri_arg, 0,
-	  "Set relative URI of a source.  Use with --source or --add-source.", "NAME" },
-	{ "set-base-uri", '\0', POPT_ARG_STRING, &set_base_uri_arg, 0,
-	  "Set base URI of a group.  Use with --group or --add-group.", "NAME" },
-	{ "set-color", '\0', POPT_ARG_STRING, &set_color_arg, 0,
-	  "Set the color of a source.  Use with --source or --add-source.", "COLOR (rrggbb)" },
-	{ "unset-color", '\0', POPT_ARG_NONE, &unset_color, 0,
-	  "Unset the color of a source.  Use with --source or --add-source.", NULL },
-	{ "set-value", '\0', POPT_ARG_STRING, &set_value_arg, 0,
-	  "Set a property on a source.  Use with --source and --property.", NULL },
-	{ "unset-value", '\0', POPT_ARG_NONE, &unset_value, 0,
-	  "Unset a property on a source.  Use with --source and --property.", NULL },
-	{ "listen", '\0', POPT_ARG_NONE, &listen, 0,
-	  "Wait and listen for changes.", "" },
-	{ "dump", '\0', POPT_ARG_NONE, &dump, 0,
-	  "List the current configured sources.", "" },
-	POPT_AUTOHELP
+static GOptionEntry entries[] = {
+	{ "key", '\0', 0, G_OPTION_ARG_STRING, &key_arg, "Name of the GConf key to use", "PATH" },
+	{ "source", '\0', 0, G_OPTION_ARG_STRING, &source_arg, "UID of source to apply operations too", "UID"},
+	{ "group", '\0', 0, G_OPTION_ARG_STRING, &group_arg, "UID of group to apply operations too", "UID" },
+	{ "add-group", '\0', 0, G_OPTION_ARG_STRING, &add_group_arg, "Add group of specified name", "GROUP" },
+	{ "add-source", '\0', 0, G_OPTION_ARG_STRING, &add_source_arg, "Add source of specified name", "SOURCE" },
+	{ "remove-group", '\0', 0, G_OPTION_ARG_STRING, &remove_group_arg, "Remove group of specified name", "GROUP" },
+	{ "remove-source", '\0', 0, G_OPTION_ARG_STRING, &remove_source_arg, "Remove source of specified name", "SOURCE" },
+	{ "property", '\0', 0, G_OPTION_ARG_STRING, &property_arg, "Name of source property to apply operation to", "PROPERTY" },
+	{ "set-name", '\0', 0, G_OPTION_ARG_STRING, &set_name_arg, "Set name of source or group.  When used with --group, it sets the name of a group. When used with both --group and --source, it sets the name of a source.", "NAME" },
+	{ "set-relative-uri", '\0', 0, G_OPTION_ARG_STRING, &set_relative_uri_arg, "Set relative URI of a source.  Use with --source or --add-source.", "NAME" },
+	{ "set-base-uri", '\0', 0, G_OPTION_ARG_STRING, &set_base_uri_arg, "Set base URI of a group.  Use with --group or --add-group.", "NAME" },
+	{ "set-color", '\0', 0, G_OPTION_ARG_STRING, &set_color_arg, "Set the color of a source.  Use with --source or --add-source.", "COLOR (rrggbb)" },
+	{ "unset-color", '\0', 0, G_OPTION_ARG_NONE, &unset_color, "Unset the color of a source.  Use with --source or --add-source.", NULL },
+	{ "set-value", '\0', 0, G_OPTION_ARG_STRING, &set_value_arg, "Set a property on a source.  Use with --source and --property.", NULL },
+	{ "unset-value", '\0', 0, G_OPTION_ARG_NONE, &unset_value, "Unset a property on a source.  Use with --source and --property.", NULL },
+	{ "listen", '\0', 0, G_OPTION_ARG_NONE, &listen, "Wait and listen for changes.", NULL },
+	{ "dump", '\0', 0, G_OPTION_ARG_NONE, &dump, "List the current configured sources.", NULL },
 	{ NULL }
 };
 
-
 /* Forward decls.  */
 static void group_added_callback (ESourceList *list, ESourceGroup *group);
 static void group_removed_callback (ESourceList *list, ESourceGroup *group);
@@ -562,15 +540,14 @@
 
 
 int
-main (int argc,
-      char **argv)
+main (int argc, char **argv)
 {
-	GnomeProgram *program;
+	GOptionContext *context;
+	GError *error = NULL;
 
-	program = gnome_program_init ("test-source-list", "0.0",
-				      LIBGNOME_MODULE, argc, argv,
-				      GNOME_PARAM_POPT_TABLE, options,
-				      NULL);
+	context = g_option_context_new ("- test source lists");
+	g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
+	g_option_context_parse (context, &argc, &argv, &error);
 
 	g_idle_add (on_idle_do_stuff, NULL);
 


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