aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/cal-backend.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-10-21 05:25:47 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-10-21 05:25:47 +0800
commit1fff2516257a785bb4597c7ad4917405bbcb8cbc (patch)
tree5f04a3c3f2e079e42fb4bacde631b340d84f6973 /calendar/pcs/cal-backend.c
parent88cbebbb3d5c27eccf5935208a90389fe608fa7f (diff)
downloadgsoc2013-evolution-1fff2516257a785bb4597c7ad4917405bbcb8cbc.tar
gsoc2013-evolution-1fff2516257a785bb4597c7ad4917405bbcb8cbc.tar.gz
gsoc2013-evolution-1fff2516257a785bb4597c7ad4917405bbcb8cbc.tar.bz2
gsoc2013-evolution-1fff2516257a785bb4597c7ad4917405bbcb8cbc.tar.lz
gsoc2013-evolution-1fff2516257a785bb4597c7ad4917405bbcb8cbc.tar.xz
gsoc2013-evolution-1fff2516257a785bb4597c7ad4917405bbcb8cbc.tar.zst
gsoc2013-evolution-1fff2516257a785bb4597c7ad4917405bbcb8cbc.zip
Pulling up stuff from the 0.6 branch
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 svn path=/trunk/; revision=6086
Diffstat (limited to 'calendar/pcs/cal-backend.c')
-rw-r--r--calendar/pcs/cal-backend.c38
1 files changed, 31 insertions, 7 deletions
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]);
}
-
-
-