aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog42
-rw-r--r--calendar/conduits/calendar/Makefile.am5
-rw-r--r--calendar/conduits/calendar/calendar-conduit-config.h2
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c4
-rw-r--r--calendar/conduits/todo/Makefile.am5
-rw-r--r--calendar/conduits/todo/todo-conduit-config.h2
-rw-r--r--calendar/conduits/todo/todo-conduit.c6
-rw-r--r--calendar/pcs/cal-backend-file.c39
-rw-r--r--calendar/pcs/cal-backend.c38
9 files changed, 103 insertions, 40 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index d21bfe0055..76a6ce2c0c 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,45 @@
+2000-10-20 JP Rosevear <jpr@helixcode.com>
+
+ * pcs/cal-backend.c (cal_backend_destroy): New destroy
+ handler to properly stop the timer, sync the log and unref
+ the URI.
+ (cal_backend_last_client_gone): Just emit the signal,
+ clean up work is done in cal_backend_destroy now.
+
+ * pcs/cal-backend-file.c (cal_backend_file_load): Unref the
+ uri we are replacing NOT the new uri.
+
+2000-10-20 JP Rosevear <jpr@helixcode.com>
+
+ * conduits/todo/Makefile.am: Fix build
+
+ * conduits/calendar/Makefile.am: Fix build
+
+2000-10-20 JP Rosevear <jpr@helixcode.com>
+
+ * conduits/calendar/calendar-conduit.c (delete_archive_record):
+ Don't throw an error
+
+ * conduits/todo/todo-conduit.c (delete_archive_record): ditto
+
+2000-10-20 JP Rosevear <jpr@helixcode.com>
+
+ * conduits/todo/todo-conduit-control-applet.c: Add defines
+
+ * conduits/todo/todo-conduit-config.h: put #ifdefs around functions
+ can't make this a public interface in the usual way as then the
+ symbols would be exported
+
+ * conduits/todo/todo-conduit.c: Kill warnings. clahey will be
+ happy! Add some defines to include only the necessary config functions.
+ (conduit_get_gpilot_conduit): Hook up archive signals
+
+ * conduits/calendar/calendar-conduit.c: Same as above
+
+ * conduits/calendar/calendar-conduit-control-applet.c: ditto
+
+ * conduits/calendar/calendar-conduit-config.h: ditto
+
2000-10-20 Michael Meeks <michael@helixcode.com>
* gui/calendar-commands.h: s/BonoboUIHandler/BonoboUIComponent/
diff --git a/calendar/conduits/calendar/Makefile.am b/calendar/conduits/calendar/Makefile.am
index e0f1d76e18..25282d9c53 100644
--- a/calendar/conduits/calendar/Makefile.am
+++ b/calendar/conduits/calendar/Makefile.am
@@ -26,7 +26,10 @@ e_calendar_conduit_control_applet_LDADD = \
e_calendar_conduitsdir=$(libdir)/gnome-pilot/conduits
e_calendar_conduits_LTLIBRARIES = libecalendar_conduit.la
-libecalendar_conduit_la_SOURCES = calendar-conduit.c
+libecalendar_conduit_la_SOURCES = \
+ calendar-conduit.c \
+ calendar-conduit.h \
+ calendar-conduit-config.h
libecalendar_conduit_la_LIBADD = \
$(top_builddir)/calendar/cal-client/libcal-client-static.la \
diff --git a/calendar/conduits/calendar/calendar-conduit-config.h b/calendar/conduits/calendar/calendar-conduit-config.h
index e353142aaa..d0ba28dbb1 100644
--- a/calendar/conduits/calendar/calendar-conduit-config.h
+++ b/calendar/conduits/calendar/calendar-conduit-config.h
@@ -29,7 +29,7 @@
#include <libgpilotdCM/gnome-pilot-conduit-management.h>
#include <libgpilotdCM/gnome-pilot-conduit-config.h>
-/* This is the configuration of the GnomeCal conduit. */
+/* Configuration info */
typedef struct _ECalConduitCfg ECalConduitCfg;
struct _ECalConduitCfg {
gboolean open_secret;
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index 3ba6e7d931..7452e0f911 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -1074,11 +1074,13 @@ delete_archive_record (GnomePilotConduitSyncAbs *conduit,
ECalLocalRecord *local,
ECalConduitContext *ctxt)
{
+ int retval = 0;
+
g_return_val_if_fail(local!=NULL,-1);
LOG ("delete_archive_record: doing nothing\n");
- return -1;
+ return retval;
}
static gint
diff --git a/calendar/conduits/todo/Makefile.am b/calendar/conduits/todo/Makefile.am
index 619a11657b..73c9dc203b 100644
--- a/calendar/conduits/todo/Makefile.am
+++ b/calendar/conduits/todo/Makefile.am
@@ -26,7 +26,10 @@ e_todo_conduit_control_applet_LDADD = \
e_todo_conduitsdir=$(libdir)/gnome-pilot/conduits
e_todo_conduits_LTLIBRARIES = libetodo_conduit.la
-libetodo_conduit_la_SOURCES = todo-conduit.c
+libetodo_conduit_la_SOURCES = \
+ todo-conduit.c \
+ todo-conduit.h \
+ todo-conduit-config.h
libetodo_conduit_la_LIBADD = \
$(top_builddir)/calendar/cal-client/libcal-client-static.la \
diff --git a/calendar/conduits/todo/todo-conduit-config.h b/calendar/conduits/todo/todo-conduit-config.h
index 7a23475839..fe7b1dbafa 100644
--- a/calendar/conduits/todo/todo-conduit-config.h
+++ b/calendar/conduits/todo/todo-conduit-config.h
@@ -29,7 +29,7 @@
#include <libgpilotdCM/gnome-pilot-conduit-management.h>
#include <libgpilotdCM/gnome-pilot-conduit-config.h>
-/* This is the configuration of the GnomeCal conduit. */
+/* Configuration info */
typedef struct _EToDoConduitCfg EToDoConduitCfg;
struct _EToDoConduitCfg {
gboolean open_secret;
diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c
index 646f850b42..d3ea9dbd63 100644
--- a/calendar/conduits/todo/todo-conduit.c
+++ b/calendar/conduits/todo/todo-conduit.c
@@ -94,8 +94,6 @@ print_local (EToDoLocalRecord *local)
}
return "";
-
- return cal_component_get_as_string (local->comp);
}
@@ -955,11 +953,13 @@ delete_archive_record (GnomePilotConduitSyncAbs *conduit,
EToDoLocalRecord *local,
EToDoConduitContext *ctxt)
{
+ int retval =0;
+
g_return_val_if_fail(local!=NULL,-1);
LOG ("delete_archive_record: doing nothing\n");
- return -1;
+ return retval;
}
static gint
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index 97e96d3d44..715e1e70bc 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -183,29 +183,21 @@ save (CalBackendFile *cbfile)
g_assert (priv->icalcomp != NULL);
/* Make a backup copy of the file if it exists */
- if (gnome_vfs_uri_exists (priv->uri)) {
- tmp = gnome_vfs_uri_to_string (priv->uri, GNOME_VFS_URI_HIDE_NONE);
- if (tmp) {
- GnomeVFSURI *backup_uri;
- gchar *backup_uristr;
-
- backup_uristr = g_strconcat (tmp, "~", NULL);
- backup_uri = gnome_vfs_uri_new (backup_uristr);
-
- result = gnome_vfs_move_uri (priv->uri, backup_uri, TRUE);
- gnome_vfs_uri_unref (backup_uri);
-
- g_free (tmp);
- g_free (backup_uristr);
- }
- } else {
- result = GNOME_VFS_OK;
+ tmp = gnome_vfs_uri_to_string (priv->uri, GNOME_VFS_URI_HIDE_NONE);
+ if (tmp) {
+ GnomeVFSURI *backup_uri;
+ gchar *backup_uristr;
+
+ backup_uristr = g_strconcat (tmp, "~", NULL);
+ backup_uri = gnome_vfs_uri_new (backup_uristr);
+
+ result = gnome_vfs_move_uri (priv->uri, backup_uri, TRUE);
+ gnome_vfs_uri_unref (backup_uri);
+
+ g_free (tmp);
+ g_free (backup_uristr);
}
-
- if (result != GNOME_VFS_OK)
- goto error;
-
/* Now write the new file out */
result = gnome_vfs_create_uri (&handle, priv->uri,
GNOME_VFS_OPEN_WRITE,
@@ -616,9 +608,6 @@ cal_backend_file_load (CalBackend *backend, GnomeVFSURI *uri)
if (!gnome_vfs_uri_is_local (uri))
return CAL_BACKEND_LOAD_ERROR;
- if (!gnome_vfs_uri_exists (uri))
- return CAL_BACKEND_LOAD_ERROR;;
-
str_uri = gnome_vfs_uri_to_string (uri,
(GNOME_VFS_URI_HIDE_USER_NAME
| GNOME_VFS_URI_HIDE_PASSWORD
@@ -659,7 +648,7 @@ cal_backend_file_load (CalBackend *backend, GnomeVFSURI *uri)
/* Clean up */
if (priv->uri)
- gnome_vfs_uri_unref (uri);
+ gnome_vfs_uri_unref (priv->uri);
gnome_vfs_uri_ref (uri);
priv->uri = uri;
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c
index beca760be1..b2b16b2c9e 100644
--- a/calendar/pcs/cal-backend.c
+++ b/calendar/pcs/cal-backend.c
@@ -3,7 +3,8 @@
*
* Copyright (C) 2000 Helix Code, Inc.
*
- * Author: Federico Mena-Quintero <federico@helixcode.com>
+ * Authors: Federico Mena-Quintero <federico@helixcode.com>
+ * JP Rosevear <jpr@helixcode.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -39,6 +40,7 @@ enum {
static void cal_backend_class_init (CalBackendClass *class);
static void cal_backend_init (CalBackend *backend);
+static void cal_backend_destroy (GtkObject *object);
static gboolean cal_backend_log_sync (CalBackend *backend);
static GHashTable *cal_backend_get_log_entries (CalBackend *backend,
CalObjType type,
@@ -95,6 +97,8 @@ cal_backend_class_init (CalBackendClass *class)
parent_class = gtk_type_class (GTK_TYPE_OBJECT);
+ object_class->destroy = cal_backend_destroy;
+
cal_backend_signals[LAST_CLIENT_GONE] =
gtk_signal_new ("last_client_gone",
GTK_RUN_FIRST,
@@ -112,6 +116,31 @@ cal_backend_init (CalBackend *backend)
{
backend->uri = NULL;
backend->entries = NULL;
+ backend->timer = -1;
+}
+
+static void
+cal_backend_destroy (GtkObject *object)
+{
+ CalBackend *backend;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (IS_CAL_BACKEND (object));
+
+ backend = CAL_BACKEND (object);
+
+ if (backend->timer != -1) {
+ gtk_timeout_remove (backend->timer);
+ backend->timer = -1;
+ }
+
+ if (backend->uri) {
+ cal_backend_log_sync (backend);
+ gnome_vfs_uri_unref (backend->uri);
+ }
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -141,7 +170,7 @@ cal_backend_set_uri (CalBackend *backend, GnomeVFSURI *uri)
if (backend->uri)
gnome_vfs_uri_unref (backend->uri);
- if (backend->timer)
+ if (backend->timer != -1)
gtk_timeout_remove (backend->timer);
@@ -733,11 +762,6 @@ cal_backend_last_client_gone (CalBackend *backend)
g_return_if_fail (backend != NULL);
g_return_if_fail (IS_CAL_BACKEND (backend));
- cal_backend_log_sync (backend);
-
gtk_signal_emit (GTK_OBJECT (backend), cal_backend_signals[LAST_CLIENT_GONE]);
}
-
-
-