[evolution-patches] Re: Patch to remove deprecated calls (patch this time)
- From: Ross Burton <ross burtonini com>
- To: Evolution Patches <evolution-patches lists ximian com>
- Subject: [evolution-patches] Re: Patch to remove deprecated calls (patch this time)
- Date: Sun, 05 Jun 2005 17:22:28 +0100
On Sun, 2005-06-05 at 17:21 +0100, Ross Burton wrote:
> Attached is a patch which does several things:
Balls. Now it's attached.
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: 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 5 Jun 2005 16:16:46 -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);
Index: libedataserverui/e-categories-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-categories-dialog.c,v
retrieving revision 1.17
diff -u -r1.17 e-categories-dialog.c
--- libedataserverui/e-categories-dialog.c 13 May 2005 13:35:29 -0000 1.17
+++ libedataserverui/e-categories-dialog.c 5 Jun 2005 16:16:46 -0000
@@ -28,6 +28,7 @@
#include <gtk/gtkcellrenderertext.h>
#include <gtk/gtkcellrenderertoggle.h>
#include <gtk/gtkentry.h>
+#include <gtk/gtkfilechooserbutton.h>
#include <gtk/gtkliststore.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkmessagedialog.h>
@@ -35,7 +36,6 @@
#include <gtk/gtkstock.h>
#include <gtk/gtktreeselection.h>
#include <gtk/gtktreeview.h>
-#include <libgnomeui/gnome-file-entry.h>
#include <glade/glade-xml.h>
#include <libedataserver/e-categories.h>
#include "e-categories-dialog.h"
@@ -88,11 +88,9 @@
/* create the icon file entry */
table = glade_xml_get_widget (prop_dialog->gui, "table-category-properties");
- prop_dialog->category_icon = gnome_file_entry_new ("category-icon-history-id", _("Category Icon"));
- g_object_set (G_OBJECT (prop_dialog->category_icon), "use_filechooser", TRUE, NULL);
+ prop_dialog->category_icon = gtk_file_chooser_button_new (_("Category Icon"), GTK_FILE_CHOOSER_ACTION_OPEN);
gtk_table_attach (GTK_TABLE (table), prop_dialog->category_icon, 1, 2, 2, 3, GTK_FILL, GTK_FILL, 3, 3);
gtk_widget_show (prop_dialog->category_icon);
- gnome_file_entry_set_modal ((GnomeFileEntry *)prop_dialog->category_icon, TRUE);
return prop_dialog;
}
@@ -271,8 +269,7 @@
g_free (correct_category_name);
} else {
/* FIXME: get color */
- category_icon = gtk_entry_get_text (
- GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (prop_dialog->category_icon))));
+ category_icon = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (prop_dialog->category_icon));
e_categories_add (correct_category_name, NULL, category_icon ? category_icon : NULL, TRUE);
@@ -324,16 +321,14 @@
gtk_tree_model_get (model, &iter, 1, &category_name, -1);
gtk_entry_set_text (GTK_ENTRY (prop_dialog->category_name), category_name);
gtk_widget_set_sensitive (prop_dialog->category_name, FALSE);
- gtk_entry_set_text (
- GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (prop_dialog->category_icon))),
- e_categories_get_icon_file_for (category_name));
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (prop_dialog->category_icon),
+ e_categories_get_icon_file_for (category_name));
if (gtk_dialog_run (GTK_DIALOG (prop_dialog->the_dialog)) == GTK_RESPONSE_OK) {
const char *category_icon;
/* FIXME: get color */
- category_icon = gtk_entry_get_text (
- GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (prop_dialog->category_icon))));
+ category_icon = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (prop_dialog->category_icon));
if (category_icon)
e_categories_set_icon_file_for (category_name, category_icon);
Index: libedataserverui/e-passwords.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/libedataserverui/e-passwords.c,v
retrieving revision 1.26
diff -u -r1.26 e-passwords.c
--- libedataserverui/e-passwords.c 23 Feb 2005 18:52:12 -0000 1.26
+++ libedataserverui/e-passwords.c 5 Jun 2005 16:16:46 -0000
@@ -744,10 +797,10 @@
-static char *base64_alphabet =
+static const char base64_alphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static unsigned char camel_mime_base64_rank[256] = {
+static const unsigned char camel_mime_base64_rank[256] = {
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255, 62,255,255,255, 63,
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 5 Jun 2005 16:16:46 -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 5 Jun 2005 16:16:46 -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]