diff options
Diffstat (limited to 'addressbook/backend/ebook/test-client.c')
-rw-r--r-- | addressbook/backend/ebook/test-client.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/addressbook/backend/ebook/test-client.c b/addressbook/backend/ebook/test-client.c index 300f25958b..96706eea7c 100644 --- a/addressbook/backend/ebook/test-client.c +++ b/addressbook/backend/ebook/test-client.c @@ -1,12 +1,9 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #include <config.h> #include <glib.h> -#include <gtk/gtkmain.h> -#include <libgnome/gnome-defs.h> -#include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-init.h> +#include <bonobo/bonobo-i18n.h> #include <bonobo/bonobo-main.h> -#include <liboaf/liboaf.h> +#include <libgnome/gnome-init.h> #include "e-book.h" #include "e-book-util.h" @@ -28,9 +25,9 @@ static CORBA_Environment ev; static char *cardstr; static void -init_bonobo (int argc, char **argv) +init_bonobo (int *argc, char **argv) { - if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) + if (bonobo_init (argc, argv) == FALSE) g_error (_("Could not initialize Bonobo")); } @@ -51,7 +48,7 @@ get_cursor_cb (EBook *book, EBookStatus status, ECardCursor *cursor, gpointer cl char *vcard = e_card_get_vcard_assume_utf8(card); printf("Get all cards callback: [%s]\n", vcard); g_free(vcard); - gtk_object_unref(GTK_OBJECT(card)); + g_object_unref(card); } } @@ -63,7 +60,7 @@ get_card_cb (EBook *book, EBookStatus status, ECard *card, gpointer closure) vcard = e_card_get_vcard_assume_utf8(card); printf ("Card added: [%s]\n", vcard); g_free(vcard); - gtk_object_unref(GTK_OBJECT(card)); + g_object_unref(card); printf ("Getting cards..\n"); e_book_get_cursor(book, "", get_cursor_cb, NULL); @@ -98,7 +95,7 @@ get_fields_cb (EBook *book, EBookStatus status, EList *fields, gpointer closure) printf (" %s\n", (char*)e_iterator_get (iter)); } - gtk_object_unref(GTK_OBJECT(fields)); + g_object_unref(fields); } else { printf ("No supported fields?\n"); @@ -121,8 +118,8 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure) e_book_authenticate_user (book, "username", "password", "auth_method", auth_user_cb, NULL); } -static guint -ebook_create (void) +static gboolean +ebook_create (gpointer data) { EBook *book; @@ -174,9 +171,10 @@ main (int argc, char **argv) CORBA_exception_init (&ev); - gnome_init_with_popt_table ("blah", "0.0", argc, argv, NULL, 0, NULL); - oaf_init (argc, argv); - init_bonobo (argc, argv); + gnome_program_init("test-client", "0.0", LIBGNOME_MODULE, argc, argv, NULL); + + bonobo_activation_init (argc, argv); + init_bonobo (&argc, argv); cardstr = NULL; if (argc == 2) @@ -185,7 +183,7 @@ main (int argc, char **argv) if (cardstr == NULL) cardstr = TEST_VCARD; - gtk_idle_add ((GtkFunction) ebook_create, NULL); + g_idle_add (ebook_create, NULL); bonobo_main (); |