aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-01-25 11:17:54 +0800
committerArturo Espinosa <unammx@src.gnome.org>2000-01-25 11:17:54 +0800
commit32ce476a23e9f2757e9cc539532f38f4ab21837c (patch)
tree4a9aeebfe355427fe035d27441b02bbc7be0bc4d /calendar
parent50e5c22f0f5c4083ceee623b5bc02a6a7fc4f18c (diff)
downloadgsoc2013-evolution-32ce476a23e9f2757e9cc539532f38f4ab21837c.tar
gsoc2013-evolution-32ce476a23e9f2757e9cc539532f38f4ab21837c.tar.gz
gsoc2013-evolution-32ce476a23e9f2757e9cc539532f38f4ab21837c.tar.bz2
gsoc2013-evolution-32ce476a23e9f2757e9cc539532f38f4ab21837c.tar.lz
gsoc2013-evolution-32ce476a23e9f2757e9cc539532f38f4ab21837c.tar.xz
gsoc2013-evolution-32ce476a23e9f2757e9cc539532f38f4ab21837c.tar.zst
gsoc2013-evolution-32ce476a23e9f2757e9cc539532f38f4ab21837c.zip
Added the gnome-pilot and capplet checks; they will likely be reworked for
2000-01-24 Federico Mena Quintero <federico@helixcode.com> * configure.in: Added the gnome-pilot and capplet checks; they will likely be reworked for the Evolution framework, but for now the calendar/ directory needs them. * configure.in: Added checks for gnome-vfs. 2000-01-24 Federico Mena Quintero <federico@helixcode.com> * tlacuache.c: New main module for the Tlacuache personal calendar server. * tlacuache.gnorba: New gnorba file for Tlacuache, the GNOME personal calendar server. * Makefile.am: Added the stuff necessary to build Tlacuache. * cal.c (Cal_get_uri): Convert the URI to a string before returning it. * cal-factory.c (CalFactory_create): Doh, this function is void. * job.c (job_add): Use g_idle_add(), not gtk_idle_add(). svn path=/trunk/; revision=1623
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog17
-rw-r--r--calendar/Makefile.am54
-rw-r--r--calendar/cal-backend.c13
-rw-r--r--calendar/cal-backend.h1
-rw-r--r--calendar/cal-factory.c17
-rw-r--r--calendar/cal.c41
-rw-r--r--calendar/gui/Makefile.am54
-rw-r--r--calendar/job.c4
-rw-r--r--calendar/job.h2
-rw-r--r--calendar/pcs/cal-backend.c13
-rw-r--r--calendar/pcs/cal-backend.h1
-rw-r--r--calendar/pcs/cal-factory.c17
-rw-r--r--calendar/pcs/cal.c41
-rw-r--r--calendar/pcs/job.c4
-rw-r--r--calendar/pcs/job.h2
-rw-r--r--calendar/pcs/tlacuache.gnorba5
-rw-r--r--calendar/tlacuache.gnorba5
17 files changed, 207 insertions, 84 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 7a4887f927..d4096c2bd8 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,22 @@
2000-01-24 Federico Mena Quintero <federico@helixcode.com>
+ * tlacuache.c: New main module for the Tlacuache personal calendar
+ server.
+
+ * tlacuache.gnorba: New gnorba file for Tlacuache, the GNOME
+ personal calendar server.
+
+ * Makefile.am: Added the stuff necessary to build Tlacuache.
+
+ * cal.c (Cal_get_uri): Convert the URI to a string before
+ returning it.
+
+ * cal-factory.c (CalFactory_create): Doh, this function is void.
+
+ * job.c (job_add): Use g_idle_add(), not gtk_idle_add().
+
+2000-01-24 Federico Mena Quintero <federico@helixcode.com>
+
* cal-backend.c (cal_backend_remove_cal): New function to remove a
calendar client interface object from a backend.
(cal_backend_load): Convert the URI to string and use
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 006102a2a7..135ffc4926 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -1,10 +1,14 @@
SUBDIRS = doc
idldir = $(datadir)/idl
-idl_DATA = GnomeCal.idl
+idl_DATA = \
+ GnomeCal.idl \
+ gnome-calendar.idl
gnorbadir = $(sysconfdir)/CORBA/servers
-gnorba_DATA = gnomecal.gnorba
+gnorba_DATA = \
+ gnomecal.gnorba \
+ tlacuache.gnorba
help_base = $(datadir)/gnome/help/cal
@@ -13,7 +17,8 @@ extra_pilot_bins = \
calendar-conduit-control-applet \
calendar-pilot-sync
endif
-bin_PROGRAMS = gnomecal $(extra_pilot_bins)
+
+bin_PROGRAMS = gnomecal tlacuache $(extra_pilot_bins)
INCLUDES = \
-I$(includedir) \
@@ -29,11 +34,8 @@ GNOMECAL_CORBA_GENERATED = \
GnomeCal-skels.c \
GnomeCal-stubs.c
-$(GNOMECAL_CORBA_GENERATED): my_gnomecal_idl
-
-my_gnomecal_idl: GnomeCal.idl
+$(GNOMECAL_CORBA_GENERATED): GnomeCal.idl
orbit-idl $(srcdir)/GnomeCal.idl
- touch my_gnomecal_idl
corba-cal.c \
corba-cal.h \
@@ -107,12 +109,46 @@ calendar_pilot_sync_SOURCES = \
timeutil.c \
timeutil.h
+GNOME_CALENDAR_CORBA_GENERATED = \
+ gnome-calendar.h \
+ gnome-calendar-common.c \
+ gnome-calendar-skels.c \
+ gnome-calendar-stubs.c
+
+$(GNOME_CALENDAR_CORBA_GENERATED): gnome-calendar.idl
+ orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl $(srcdir)/gnome-calendar.idl
+
+tlacuache_SOURCES = \
+ $(GNOME_CALENDAR_CORBA_GENERATED) \
+ cal.c \
+ cal.h \
+ cal-backend.c \
+ cal-backend.h \
+ cal-common.h \
+ cal-factory.c \
+ cal-factory.h \
+ calobj.c \
+ calobj.h \
+ job.c \
+ job.h \
+ timeutil.c \
+ timeutil.h \
+ tlacuache.c
+
LINK_FLAGS = \
$(GNOME_LIBDIR) \
$(GNOMEGNORBA_LIBS) \
$(INTLLIBS) \
../libversit/libversit.la
+tlacuache_INCLUDES = \
+ $(INCLUDES) \
+ -DG_LOG_DOMAIN=\"tlacuache\"
+
+tlacuache_LDADD = \
+ $(BONOBO_VFS_GNOME_LIBS) \
+ ../libversit/libversit.la
+
calendar_pilot_sync_LDADD = \
$(PISOCK_LIBDIR) $(PISOCK_LIBS) \
$(LINK_FLAGS)
@@ -185,6 +221,10 @@ calendar_conduit_control_applet_LDADD = \
# $(GNOME_PILOT_LIBS) \
# $(INTLLIBS)
+gnomecal_INCLUDES = \
+ $(INCLUDES) \
+ -DG_LOG_DOMAIN=\"gnomecal\"
+
gnomecal_LDADD = $(LINK_FLAGS)
if HAVE_GNOME_PILOT
diff --git a/calendar/cal-backend.c b/calendar/cal-backend.c
index 649a1dd8f4..6382d1f592 100644
--- a/calendar/cal-backend.c
+++ b/calendar/cal-backend.c
@@ -21,6 +21,7 @@
#include <config.h>
#include "cal-backend.h"
+#include "calobj.h"
#include "../libversit/vcc.h"
@@ -209,7 +210,7 @@ load_from_vobject (CalBackend *backend, VObject *vobject)
this = nextVObject (&i);
object_name = vObjectName (this);
#if 0
- /* FIXME? What is this used for? */
+ /* FIXME? What is this used for in gnomecal? */
if (strcmp (object_name, VCDCreatedProp) == 0) {
cal->created = time_from_isodate (str_val (this));
continue;
@@ -248,7 +249,7 @@ load_from_vobject (CalBackend *backend, VObject *vobject)
CalBackend *
cal_backend_new (void)
{
- return CAL_BACKEND (gtk_type_new (TYPE_CAL_BACKEND));
+ return CAL_BACKEND (gtk_type_new (CAL_BACKEND_TYPE));
}
/**
@@ -266,7 +267,7 @@ cal_backend_get_uri (CalBackend *backend)
CalBackendPrivate *priv;
g_return_val_if_fail (backend != NULL, NULL);
- g_return_val_if_fail (IS_CAL_BACKEND, NULL);
+ g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL);
priv = backend->priv;
g_return_val_if_fail (priv->loaded, NULL);
@@ -297,7 +298,7 @@ cal_backend_add_cal (CalBackend *backend, Cal *cal)
g_return_if_fail (cal != NULL);
g_return_if_fail (IS_CAL (cal));
- gtk_object_ref (cal);
+ gtk_object_ref (GTK_OBJECT (cal));
priv->clients = g_list_prepend (priv->clients, cal);
}
@@ -328,9 +329,9 @@ cal_backend_remove_cal (CalBackend *backend, Cal *cal)
if (!l)
return;
- gtk_object_unref (cal);
+ gtk_object_unref (GTK_OBJECT (cal));
priv->clients = g_list_remove_link (priv->clients, l);
- g_list_free1 (l);
+ g_list_free_1 (l);
}
/**
diff --git a/calendar/cal-backend.h b/calendar/cal-backend.h
index 3c60b6961c..d220943c00 100644
--- a/calendar/cal-backend.h
+++ b/calendar/cal-backend.h
@@ -23,6 +23,7 @@
#define CAL_BACKEND_H
#include <libgnome/gnome-defs.h>
+#include <libgnomevfs/gnome-vfs.h>
#include "gnome-calendar.h"
#include "cal-common.h"
#include "cal.h"
diff --git a/calendar/cal-factory.c b/calendar/cal-factory.c
index 2f31355e73..6a522df67f 100644
--- a/calendar/cal-factory.c
+++ b/calendar/cal-factory.c
@@ -89,7 +89,7 @@ init_cal_factory_corba_class (void)
static void
cal_factory_class_init (CalFactoryClass *class)
{
- GtkObjectClass *parent_class;
+ GtkObjectClass *object_class;
object_class = (GtkObjectClass *) class;
@@ -156,7 +156,7 @@ cal_factory_destroy (GtkObject *object)
/* CalFactory::load method */
static void
CalFactory_load (PortableServer_Servant servant,
- CORBA_char *uri,
+ const CORBA_char *uri,
GNOME_Calendar_Listener listener,
CORBA_Environment *ev)
{
@@ -170,9 +170,9 @@ CalFactory_load (PortableServer_Servant servant,
}
/* CalFactory::create method */
-static GNOME_Calendar_Cal
+static void
CalFactory_create (PortableServer_Servant servant,
- CORBA_char *uri,
+ const CORBA_char *uri,
GNOME_Calendar_Listener listener,
CORBA_Environment *ev)
{
@@ -226,7 +226,7 @@ lookup_backend (CalFactory *factory, GnomeVFSURI *uri)
priv = factory->priv;
backend = g_hash_table_lookup (priv->backends, uri);
- return cal;
+ return backend;
}
/* Loads a calendar backend and puts it in the factory's backend hash table */
@@ -236,7 +236,6 @@ load_backend (CalFactory *factory, GnomeVFSURI *uri, GNOME_Calendar_Listener lis
CalFactoryPrivate *priv;
CalBackend *backend;
CalBackendLoadStatus status;
- CORBA_Environment ev;
priv = factory->priv;
@@ -256,7 +255,7 @@ load_backend (CalFactory *factory, GnomeVFSURI *uri, GNOME_Calendar_Listener lis
return backend;
case CAL_BACKEND_LOAD_ERROR:
- gtk_object_unref (backend);
+ gtk_object_unref (GTK_OBJECT (backend));
return NULL;
default:
@@ -310,7 +309,7 @@ add_calendar_client (CalFactory *factory, CalBackend *backend, GNOME_Calendar_Li
static void
load_fn (gpointer data)
{
- LoadCreateJobData jd;
+ LoadCreateJobData *jd;
CalFactory *factory;
GnomeVFSURI *uri;
GNOME_Calendar_Listener listener;
@@ -447,7 +446,7 @@ cal_factory_new (void)
if (ev._major != CORBA_NO_EXCEPTION || retval) {
g_message ("cal_factory_new(): could not create the CORBA factory");
- gtk_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
CORBA_exception_free (&ev);
return NULL;
}
diff --git a/calendar/cal.c b/calendar/cal.c
index be7c8e74eb..f855def92b 100644
--- a/calendar/cal.c
+++ b/calendar/cal.c
@@ -31,7 +31,7 @@ typedef struct {
CalBackend *backend;
/* Listener on the client we notify */
- GNOME_Calendar_listener listener;
+ GNOME_Calendar_Listener listener;
} CalPrivate;
@@ -119,8 +119,7 @@ cal_destroy (GtkObject *object)
{
Cal *cal;
CalPrivate *priv;
- GList *l;
- CORBA_Environment *ev;
+ CORBA_Environment ev;
g_return_if_fail (object != NULL);
g_return_if_fail (IS_CAL (object));
@@ -129,13 +128,11 @@ cal_destroy (GtkObject *object)
priv = cal->priv;
CORBA_exception_init (&ev);
+ CORBA_Object_release (priv->listener, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION)
+ g_message ("cal_destroy(): could not release the listener");
- for (l = priv->listeners; l; l = l->next) {
- GNOME_Unknown_unref (l->data, &ev);
- CORBA_Object_release (l->data, &ev);
- }
-
- g_list_free (priv->listeners);
+ CORBA_exception_free (&ev);
g_free (priv);
@@ -143,7 +140,6 @@ cal_destroy (GtkObject *object)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
-
/* CORBA servant implementation */
@@ -155,11 +151,20 @@ Cal_get_uri (PortableServer_Servant servant,
{
Cal *cal;
CalPrivate *priv;
+ GnomeVFSURI *uri;
+ char *str_uri;
+ CORBA_char *str_uri_copy;
cal = CAL (gnome_object_from_servant (servant));
priv = cal->priv;
- return CORBA_string_dup (priv->uri);
+ uri = cal_backend_get_uri (priv->backend);
+ str_uri = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ str_uri_copy = CORBA_string_dup (str_uri);
+ g_free (str_uri);
+
+ return str_uri_copy;
+
}
/**
@@ -176,7 +181,7 @@ cal_get_epv (void)
POA_GNOME_Calendar_Cal__epv *epv;
epv = g_new0 (POA_GNOME_Calendar_Cal__epv, 1);
- epv->get_uri = Cal_get_uri;
+ epv->_get_uri = Cal_get_uri;
return epv;
}
@@ -207,8 +212,8 @@ cal_construct (Cal *cal,
g_return_val_if_fail (cal != NULL, NULL);
g_return_val_if_fail (IS_CAL (cal), NULL);
- g_return_val_if_fail (backend != NULL);
- g_return_val_if_fail (IS_CAL_BACKEND (backend));
+ g_return_val_if_fail (backend != NULL, NULL);
+ g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL);
priv = cal->priv;
@@ -283,14 +288,14 @@ cal_new (CalBackend *backend, GNOME_Calendar_Listener listener)
CORBA_Environment ev;
gboolean ret;
- g_return_val_if_fail (backend != NULL);
- g_return_val_if_fail (IS_CAL_BACKEND (backend));
+ g_return_val_if_fail (backend != NULL, NULL);
+ g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL);
cal = CAL (gtk_type_new (CAL_TYPE));
corba_cal = cal_corba_object_create (GNOME_OBJECT (cal));
CORBA_exception_init (&ev);
- ret = CORBA_object_is_nil (corba_cal, &ev);
+ ret = CORBA_Object_is_nil ((CORBA_Object) corba_cal, &ev);
if (ev._major != CORBA_NO_EXCEPTION || ret) {
g_message ("cal_new(): could not create the CORBA object");
gtk_object_unref (GTK_OBJECT (cal));
@@ -303,7 +308,7 @@ cal_new (CalBackend *backend, GNOME_Calendar_Listener listener)
retval = cal_construct (cal, corba_cal, backend, listener);
if (!retval) {
g_message ("cal_new(): could not construct the calendar client interface");
- gtk_object_unref (cal);
+ gtk_object_unref (GTK_OBJECT (cal));
return NULL;
}
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index 006102a2a7..135ffc4926 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -1,10 +1,14 @@
SUBDIRS = doc
idldir = $(datadir)/idl
-idl_DATA = GnomeCal.idl
+idl_DATA = \
+ GnomeCal.idl \
+ gnome-calendar.idl
gnorbadir = $(sysconfdir)/CORBA/servers
-gnorba_DATA = gnomecal.gnorba
+gnorba_DATA = \
+ gnomecal.gnorba \
+ tlacuache.gnorba
help_base = $(datadir)/gnome/help/cal
@@ -13,7 +17,8 @@ extra_pilot_bins = \
calendar-conduit-control-applet \
calendar-pilot-sync
endif
-bin_PROGRAMS = gnomecal $(extra_pilot_bins)
+
+bin_PROGRAMS = gnomecal tlacuache $(extra_pilot_bins)
INCLUDES = \
-I$(includedir) \
@@ -29,11 +34,8 @@ GNOMECAL_CORBA_GENERATED = \
GnomeCal-skels.c \
GnomeCal-stubs.c
-$(GNOMECAL_CORBA_GENERATED): my_gnomecal_idl
-
-my_gnomecal_idl: GnomeCal.idl
+$(GNOMECAL_CORBA_GENERATED): GnomeCal.idl
orbit-idl $(srcdir)/GnomeCal.idl
- touch my_gnomecal_idl
corba-cal.c \
corba-cal.h \
@@ -107,12 +109,46 @@ calendar_pilot_sync_SOURCES = \
timeutil.c \
timeutil.h
+GNOME_CALENDAR_CORBA_GENERATED = \
+ gnome-calendar.h \
+ gnome-calendar-common.c \
+ gnome-calendar-skels.c \
+ gnome-calendar-stubs.c
+
+$(GNOME_CALENDAR_CORBA_GENERATED): gnome-calendar.idl
+ orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl $(srcdir)/gnome-calendar.idl
+
+tlacuache_SOURCES = \
+ $(GNOME_CALENDAR_CORBA_GENERATED) \
+ cal.c \
+ cal.h \
+ cal-backend.c \
+ cal-backend.h \
+ cal-common.h \
+ cal-factory.c \
+ cal-factory.h \
+ calobj.c \
+ calobj.h \
+ job.c \
+ job.h \
+ timeutil.c \
+ timeutil.h \
+ tlacuache.c
+
LINK_FLAGS = \
$(GNOME_LIBDIR) \
$(GNOMEGNORBA_LIBS) \
$(INTLLIBS) \
../libversit/libversit.la
+tlacuache_INCLUDES = \
+ $(INCLUDES) \
+ -DG_LOG_DOMAIN=\"tlacuache\"
+
+tlacuache_LDADD = \
+ $(BONOBO_VFS_GNOME_LIBS) \
+ ../libversit/libversit.la
+
calendar_pilot_sync_LDADD = \
$(PISOCK_LIBDIR) $(PISOCK_LIBS) \
$(LINK_FLAGS)
@@ -185,6 +221,10 @@ calendar_conduit_control_applet_LDADD = \
# $(GNOME_PILOT_LIBS) \
# $(INTLLIBS)
+gnomecal_INCLUDES = \
+ $(INCLUDES) \
+ -DG_LOG_DOMAIN=\"gnomecal\"
+
gnomecal_LDADD = $(LINK_FLAGS)
if HAVE_GNOME_PILOT
diff --git a/calendar/job.c b/calendar/job.c
index deb62136f1..d97df6d883 100644
--- a/calendar/job.c
+++ b/calendar/job.c
@@ -39,7 +39,7 @@ static guint jobs_idle_id;
/* Runs a job and dequeues it */
-static gint
+static gboolean
run_job (gpointer data)
{
Job *job;
@@ -88,7 +88,7 @@ job_add (JobFunc func, gpointer data)
jobs_head = g_slist_append (NULL, job);
jobs_tail = jobs_head;
- jobs_idle_id = gtk_idle_add (run_job, NULL);
+ jobs_idle_id = g_idle_add (run_job, NULL);
} else {
g_assert (jobs_tail != NULL);
g_assert (jobs_idle_id != 0);
diff --git a/calendar/job.h b/calendar/job.h
index 07404bd7c0..c9bce24dd4 100644
--- a/calendar/job.h
+++ b/calendar/job.h
@@ -22,6 +22,8 @@
#ifndef JOB_H
#define JOB_H
+#include <glib.h>
+
typedef void (* JobFunc) (gpointer data);
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c
index 649a1dd8f4..6382d1f592 100644
--- a/calendar/pcs/cal-backend.c
+++ b/calendar/pcs/cal-backend.c
@@ -21,6 +21,7 @@
#include <config.h>
#include "cal-backend.h"
+#include "calobj.h"
#include "../libversit/vcc.h"
@@ -209,7 +210,7 @@ load_from_vobject (CalBackend *backend, VObject *vobject)
this = nextVObject (&i);
object_name = vObjectName (this);
#if 0
- /* FIXME? What is this used for? */
+ /* FIXME? What is this used for in gnomecal? */
if (strcmp (object_name, VCDCreatedProp) == 0) {
cal->created = time_from_isodate (str_val (this));
continue;
@@ -248,7 +249,7 @@ load_from_vobject (CalBackend *backend, VObject *vobject)
CalBackend *
cal_backend_new (void)
{
- return CAL_BACKEND (gtk_type_new (TYPE_CAL_BACKEND));
+ return CAL_BACKEND (gtk_type_new (CAL_BACKEND_TYPE));
}
/**
@@ -266,7 +267,7 @@ cal_backend_get_uri (CalBackend *backend)
CalBackendPrivate *priv;
g_return_val_if_fail (backend != NULL, NULL);
- g_return_val_if_fail (IS_CAL_BACKEND, NULL);
+ g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL);
priv = backend->priv;
g_return_val_if_fail (priv->loaded, NULL);
@@ -297,7 +298,7 @@ cal_backend_add_cal (CalBackend *backend, Cal *cal)
g_return_if_fail (cal != NULL);
g_return_if_fail (IS_CAL (cal));
- gtk_object_ref (cal);
+ gtk_object_ref (GTK_OBJECT (cal));
priv->clients = g_list_prepend (priv->clients, cal);
}
@@ -328,9 +329,9 @@ cal_backend_remove_cal (CalBackend *backend, Cal *cal)
if (!l)
return;
- gtk_object_unref (cal);
+ gtk_object_unref (GTK_OBJECT (cal));
priv->clients = g_list_remove_link (priv->clients, l);
- g_list_free1 (l);
+ g_list_free_1 (l);
}
/**
diff --git a/calendar/pcs/cal-backend.h b/calendar/pcs/cal-backend.h
index 3c60b6961c..d220943c00 100644
--- a/calendar/pcs/cal-backend.h
+++ b/calendar/pcs/cal-backend.h
@@ -23,6 +23,7 @@
#define CAL_BACKEND_H
#include <libgnome/gnome-defs.h>
+#include <libgnomevfs/gnome-vfs.h>
#include "gnome-calendar.h"
#include "cal-common.h"
#include "cal.h"
diff --git a/calendar/pcs/cal-factory.c b/calendar/pcs/cal-factory.c
index 2f31355e73..6a522df67f 100644
--- a/calendar/pcs/cal-factory.c
+++ b/calendar/pcs/cal-factory.c
@@ -89,7 +89,7 @@ init_cal_factory_corba_class (void)
static void
cal_factory_class_init (CalFactoryClass *class)
{
- GtkObjectClass *parent_class;
+ GtkObjectClass *object_class;
object_class = (GtkObjectClass *) class;
@@ -156,7 +156,7 @@ cal_factory_destroy (GtkObject *object)
/* CalFactory::load method */
static void
CalFactory_load (PortableServer_Servant servant,
- CORBA_char *uri,
+ const CORBA_char *uri,
GNOME_Calendar_Listener listener,
CORBA_Environment *ev)
{
@@ -170,9 +170,9 @@ CalFactory_load (PortableServer_Servant servant,
}
/* CalFactory::create method */
-static GNOME_Calendar_Cal
+static void
CalFactory_create (PortableServer_Servant servant,
- CORBA_char *uri,
+ const CORBA_char *uri,
GNOME_Calendar_Listener listener,
CORBA_Environment *ev)
{
@@ -226,7 +226,7 @@ lookup_backend (CalFactory *factory, GnomeVFSURI *uri)
priv = factory->priv;
backend = g_hash_table_lookup (priv->backends, uri);
- return cal;
+ return backend;
}
/* Loads a calendar backend and puts it in the factory's backend hash table */
@@ -236,7 +236,6 @@ load_backend (CalFactory *factory, GnomeVFSURI *uri, GNOME_Calendar_Listener lis
CalFactoryPrivate *priv;
CalBackend *backend;
CalBackendLoadStatus status;
- CORBA_Environment ev;
priv = factory->priv;
@@ -256,7 +255,7 @@ load_backend (CalFactory *factory, GnomeVFSURI *uri, GNOME_Calendar_Listener lis
return backend;
case CAL_BACKEND_LOAD_ERROR:
- gtk_object_unref (backend);
+ gtk_object_unref (GTK_OBJECT (backend));
return NULL;
default:
@@ -310,7 +309,7 @@ add_calendar_client (CalFactory *factory, CalBackend *backend, GNOME_Calendar_Li
static void
load_fn (gpointer data)
{
- LoadCreateJobData jd;
+ LoadCreateJobData *jd;
CalFactory *factory;
GnomeVFSURI *uri;
GNOME_Calendar_Listener listener;
@@ -447,7 +446,7 @@ cal_factory_new (void)
if (ev._major != CORBA_NO_EXCEPTION || retval) {
g_message ("cal_factory_new(): could not create the CORBA factory");
- gtk_object_unref (factory);
+ gtk_object_unref (GTK_OBJECT (factory));
CORBA_exception_free (&ev);
return NULL;
}
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index be7c8e74eb..f855def92b 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -31,7 +31,7 @@ typedef struct {
CalBackend *backend;
/* Listener on the client we notify */
- GNOME_Calendar_listener listener;
+ GNOME_Calendar_Listener listener;
} CalPrivate;
@@ -119,8 +119,7 @@ cal_destroy (GtkObject *object)
{
Cal *cal;
CalPrivate *priv;
- GList *l;
- CORBA_Environment *ev;
+ CORBA_Environment ev;
g_return_if_fail (object != NULL);
g_return_if_fail (IS_CAL (object));
@@ -129,13 +128,11 @@ cal_destroy (GtkObject *object)
priv = cal->priv;
CORBA_exception_init (&ev);
+ CORBA_Object_release (priv->listener, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION)
+ g_message ("cal_destroy(): could not release the listener");
- for (l = priv->listeners; l; l = l->next) {
- GNOME_Unknown_unref (l->data, &ev);
- CORBA_Object_release (l->data, &ev);
- }
-
- g_list_free (priv->listeners);
+ CORBA_exception_free (&ev);
g_free (priv);
@@ -143,7 +140,6 @@ cal_destroy (GtkObject *object)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
-
/* CORBA servant implementation */
@@ -155,11 +151,20 @@ Cal_get_uri (PortableServer_Servant servant,
{
Cal *cal;
CalPrivate *priv;
+ GnomeVFSURI *uri;
+ char *str_uri;
+ CORBA_char *str_uri_copy;
cal = CAL (gnome_object_from_servant (servant));
priv = cal->priv;
- return CORBA_string_dup (priv->uri);
+ uri = cal_backend_get_uri (priv->backend);
+ str_uri = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
+ str_uri_copy = CORBA_string_dup (str_uri);
+ g_free (str_uri);
+
+ return str_uri_copy;
+
}
/**
@@ -176,7 +181,7 @@ cal_get_epv (void)
POA_GNOME_Calendar_Cal__epv *epv;
epv = g_new0 (POA_GNOME_Calendar_Cal__epv, 1);
- epv->get_uri = Cal_get_uri;
+ epv->_get_uri = Cal_get_uri;
return epv;
}
@@ -207,8 +212,8 @@ cal_construct (Cal *cal,
g_return_val_if_fail (cal != NULL, NULL);
g_return_val_if_fail (IS_CAL (cal), NULL);
- g_return_val_if_fail (backend != NULL);
- g_return_val_if_fail (IS_CAL_BACKEND (backend));
+ g_return_val_if_fail (backend != NULL, NULL);
+ g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL);
priv = cal->priv;
@@ -283,14 +288,14 @@ cal_new (CalBackend *backend, GNOME_Calendar_Listener listener)
CORBA_Environment ev;
gboolean ret;
- g_return_val_if_fail (backend != NULL);
- g_return_val_if_fail (IS_CAL_BACKEND (backend));
+ g_return_val_if_fail (backend != NULL, NULL);
+ g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL);
cal = CAL (gtk_type_new (CAL_TYPE));
corba_cal = cal_corba_object_create (GNOME_OBJECT (cal));
CORBA_exception_init (&ev);
- ret = CORBA_object_is_nil (corba_cal, &ev);
+ ret = CORBA_Object_is_nil ((CORBA_Object) corba_cal, &ev);
if (ev._major != CORBA_NO_EXCEPTION || ret) {
g_message ("cal_new(): could not create the CORBA object");
gtk_object_unref (GTK_OBJECT (cal));
@@ -303,7 +308,7 @@ cal_new (CalBackend *backend, GNOME_Calendar_Listener listener)
retval = cal_construct (cal, corba_cal, backend, listener);
if (!retval) {
g_message ("cal_new(): could not construct the calendar client interface");
- gtk_object_unref (cal);
+ gtk_object_unref (GTK_OBJECT (cal));
return NULL;
}
diff --git a/calendar/pcs/job.c b/calendar/pcs/job.c
index deb62136f1..d97df6d883 100644
--- a/calendar/pcs/job.c
+++ b/calendar/pcs/job.c
@@ -39,7 +39,7 @@ static guint jobs_idle_id;
/* Runs a job and dequeues it */
-static gint
+static gboolean
run_job (gpointer data)
{
Job *job;
@@ -88,7 +88,7 @@ job_add (JobFunc func, gpointer data)
jobs_head = g_slist_append (NULL, job);
jobs_tail = jobs_head;
- jobs_idle_id = gtk_idle_add (run_job, NULL);
+ jobs_idle_id = g_idle_add (run_job, NULL);
} else {
g_assert (jobs_tail != NULL);
g_assert (jobs_idle_id != 0);
diff --git a/calendar/pcs/job.h b/calendar/pcs/job.h
index 07404bd7c0..c9bce24dd4 100644
--- a/calendar/pcs/job.h
+++ b/calendar/pcs/job.h
@@ -22,6 +22,8 @@
#ifndef JOB_H
#define JOB_H
+#include <glib.h>
+
typedef void (* JobFunc) (gpointer data);
diff --git a/calendar/pcs/tlacuache.gnorba b/calendar/pcs/tlacuache.gnorba
new file mode 100644
index 0000000000..acf2289229
--- /dev/null
+++ b/calendar/pcs/tlacuache.gnorba
@@ -0,0 +1,5 @@
+[calendar:cal-factory]
+type=exe
+repo_id=IDL:GNOME/Calendar/CalFactory:1.0
+description=Calendar factory for the Personal Calendar Server
+location_info=tlacuache
diff --git a/calendar/tlacuache.gnorba b/calendar/tlacuache.gnorba
new file mode 100644
index 0000000000..acf2289229
--- /dev/null
+++ b/calendar/tlacuache.gnorba
@@ -0,0 +1,5 @@
+[calendar:cal-factory]
+type=exe
+repo_id=IDL:GNOME/Calendar/CalFactory:1.0
+description=Calendar factory for the Personal Calendar Server
+location_info=tlacuache