[evolution-patches] Remove deprecated APIs in libedataserver(ui)
- From: Ross Burton <ross burtonini com>
- To: Evolution Patches <evolution-patches lists ximian com>
- Subject: [evolution-patches] Remove deprecated APIs in libedataserver(ui)
- Date: Mon, 04 Jul 2005 13:12:30 +0100
Hi,
Today I noticed that my patches against EDS now total 100K so I'm
determined to get some of this upstream!
The attached patch will be committed with a changelog entry, and removes
libgnome/bonobo use from the libedataserver(ui) tests (where it is
undeeded), and ports test-source-list from GnomeProgram to GOption.
Very trivial stuff, honest.
Thanks,
Ross
--
Ross Burton mail: ross burtonini com
jabber: ross burtonini com
www: http://www.burtonini.com./
PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF
Index: configure.in
===================================================================
--- configure.in (.../upstream/current) (revision 126)
+++ configure.in (.../trunk) (revision 126)
@@ -1081,13 +1128,13 @@
dnl --- libedataserver and libedataserverui flags
-E_DATA_SERVER_DEPS="libxml-2.0 gobject-2.0 >= $GLIB_REQUIRED libbonobo-2.0 >= $LIBBONOBO_REQUIRED libgnome-2.0 gnome-vfs-2.0 $mozilla_nspr"
+E_DATA_SERVER_DEPS="libxml-2.0 gobject-2.0 >= $GLIB_REQUIRED libbonobo-2.0 >= $LIBBONOBO_REQUIRED gconf-2.0 gnome-vfs-2.0 $mozilla_nspr"
EVO_SET_COMPILE_FLAGS(E_DATA_SERVER, $E_DATA_SERVER_DEPS, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS)
AC_SUBST(E_DATA_SERVER_CFLAGS)
AC_SUBST(E_DATA_SERVER_LIBS)
-E_DATA_SERVER_UI_DEPS="libxml-2.0 libbonobo-2.0 >= $LIBBONOBO_REQUIRED libgnome-2.0 gtk+-2.0 libgnomeui-2.0 libglade-2.0"
+E_DATA_SERVER_UI_DEPS="libxml-2.0 libbonobo-2.0 >= $LIBBONOBO_REQUIRED libgnome-2.0 gtk+-2.0 gconf-2.0 libglade-2.0"
EVO_SET_COMPILE_FLAGS(E_DATA_SERVER_UI, $E_DATA_SERVER_UI_DEPS, $THREADS_CFLAGS, $THREADS_LIBS)
AC_SUBST(E_DATA_SERVER_UI_CFLAGS)
Index: libedataserverui/test-name-selector.c
===================================================================
--- libedataserverui/test-name-selector.c (.../upstream/current) (revision 126)
+++ libedataserverui/test-name-selector.c (.../trunk) (revision 126)
@@ -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;
+ gtk_init (&argc, &argv);
+ g_thread_init (NULL);
- 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.");
-
camel_init (NULL, 0);
g_idle_add ((GSourceFunc) start_test, NULL);
- bonobo_main ();
+ gtk_main ();
return 0;
}
Index: libedataserverui/test-contact-store.c
===================================================================
--- libedataserverui/test-contact-store.c (.../upstream/current) (revision 126)
+++ libedataserverui/test-contact-store.c (.../trunk) (revision 126)
@@ -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,16 +118,10 @@
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);
+ gtk_init (&argc, &argv);
- if (bonobo_init (&argc, argv) == FALSE)
- g_error ("Could not initialize Bonobo.");
-
if (argc < 2)
gconf_path = "/apps/evolution/addressbook/sources";
else
@@ -137,7 +129,7 @@
g_idle_add ((GSourceFunc) start_test, (void *) gconf_path);
- bonobo_main ();
+ gtk_main ();
return 0;
}
Index: libedataserver/test-source-list.c
===================================================================
--- libedataserver/test-source-list.c (.../upstream/current) (revision 126)
+++ libedataserver/test-source-list.c (.../trunk) (revision 126)
@@ -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]