aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2003-11-17 06:37:13 +0800
committerJP Rosevear <jpr@src.gnome.org>2003-11-17 06:37:13 +0800
commit8b1e261b3e451e1a28176cc1b835634a1a30d0d8 (patch)
tree71828b4730a0e6184c9bc7c222616f2ea47ab58d /calendar/gui/gnome-cal.c
parentccdc51ce37535be6efc345c160d874a1f94ea175 (diff)
downloadgsoc2013-evolution-8b1e261b3e451e1a28176cc1b835634a1a30d0d8.tar
gsoc2013-evolution-8b1e261b3e451e1a28176cc1b835634a1a30d0d8.tar.gz
gsoc2013-evolution-8b1e261b3e451e1a28176cc1b835634a1a30d0d8.tar.bz2
gsoc2013-evolution-8b1e261b3e451e1a28176cc1b835634a1a30d0d8.tar.lz
gsoc2013-evolution-8b1e261b3e451e1a28176cc1b835634a1a30d0d8.tar.xz
gsoc2013-evolution-8b1e261b3e451e1a28176cc1b835634a1a30d0d8.tar.zst
gsoc2013-evolution-8b1e261b3e451e1a28176cc1b835634a1a30d0d8.zip
add it via e-tasks (remove_uri_for_source): remove it via e-tasks
2003-11-16 JP Rosevear <jpr@ximian.com> * gui/tasks-component.c (add_uri_for_source): add it via e-tasks (remove_uri_for_source): remove it via e-tasks (get_default_task): provide a default for editing (impl_createControls): create the control directly (impl_requestCreateItem): implement * gui/gnome-cal.c (gnome_calendar_purge): don't let the two list iterators clobber each other * gui/e-tasks.h: add protos * gui/e-tasks.c (e_tasks_destroy): free the client list and the hash, disconnect signals (e_tasks_new_task): use the default client (e_tasks_add_todo_uri): add a uri (e_tasks_remove_todo_uri): remove a uri (e_tasks_set_default_uri): set default uri (e_tasks_get_default_client): get default client (e_tasks_delete_completed): expunge from all clients (e_tasks_setup_view_menus): use default client uri * gui/e-tasks.c (set_timezone): set the timezone for all clients (e_tasks_init): set up the clients has table * gui/e-calendar-table.etspec: yank some useless display columns * gui/e-cal-model.c (remove_client): remove objects in reverse order so we don't clobber ourselves * gui/calendar-component.c: add FIXME svn path=/trunk/; revision=23373
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index a034c4d4fb..3cc8e4e0cc 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -70,14 +70,12 @@
/* Private part of the GnomeCalendar structure */
struct _GnomeCalendarPrivate {
- /*
- * The Calendar Folder.
- */
-
+ /* The calendars for display */
GHashTable *clients;
GList *clients_list;
/* Set of categories from the calendar client */
+ /* FIXME are we getting all the categories? */
GPtrArray *cal_categories;
/*
@@ -2217,6 +2215,7 @@ gnome_calendar_add_event_uri (GnomeCalendar *gcal, const char *str_uri)
g_signal_connect (G_OBJECT (client), "categories_changed", G_CALLBACK (client_categories_changed_cb), gcal);
g_signal_connect (G_OBJECT (client), "backend_died", G_CALLBACK (backend_died_cb), gcal);
+ /* FIXME Do this async? */
if (!e_cal_open (client, FALSE, NULL)) {
g_hash_table_remove (priv->clients, str_uri);
priv->clients_list = g_list_prepend (priv->clients_list, client);
@@ -2256,6 +2255,7 @@ gnome_calendar_remove_event_uri (GnomeCalendar *gcal, const char *str_uri)
ECal *client;
int i;
+ g_return_val_if_fail (gcal != NULL, FALSE);
g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE);
g_return_val_if_fail (str_uri != NULL, FALSE);
@@ -2284,15 +2284,6 @@ gnome_calendar_remove_event_uri (GnomeCalendar *gcal, const char *str_uri)
}
/**
- * gnome_calendar_set_default_uri
- * @gcal: A calendar view.
- * @client: The client to use as default.
- *
- * Set the default client on the given calendar view. The default calendar will
- * be used as the default when creating events in the view.
- */
-
-/**
* gnome_calendar_set_default_uri:
* @gcal: A calendar view
* @uri: The uri to use as default
@@ -2305,17 +2296,19 @@ gnome_calendar_remove_event_uri (GnomeCalendar *gcal, const char *str_uri)
* otherwise
**/
gboolean
-gnome_calendar_set_default_uri (GnomeCalendar *gcal, const char *uri)
+gnome_calendar_set_default_uri (GnomeCalendar *gcal, const char *str_uri)
{
GnomeCalendarPrivate *priv;
ECal *client;
int i;
+ g_return_val_if_fail (gcal != NULL, FALSE);
g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE);
+ g_return_val_if_fail (str_uri != NULL, FALSE);
priv = gcal->priv;
- client = g_hash_table_lookup (priv->clients, uri);
+ client = g_hash_table_lookup (priv->clients, str_uri);
if (!client)
return FALSE;
@@ -2902,7 +2895,7 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than)
/* FIXME Confirm expunge */
for (l = priv->clients_list; l != NULL; l = l->next) {
ECal *client = l->data;
- GList *objects, *l;
+ GList *objects, *m;
gboolean read_only = TRUE;
e_cal_is_read_only (client, &read_only, NULL);
@@ -2915,12 +2908,12 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than)
continue;
}
- for (l = objects; l; l = l->next) {
+ for (m = objects; m; m = m->next) {
ECalComponent *comp;
gboolean remove = TRUE;
comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (l->data));
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (m->data));
e_cal_recur_generate_instances (comp, older_than, -1,
(ECalRecurInstanceFn) check_instance_cb,
@@ -2930,7 +2923,7 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than)
/* FIXME Better error handling */
if (remove)
- e_cal_remove_object (client, icalcomponent_get_uid (l->data), NULL);
+ e_cal_remove_object (client, icalcomponent_get_uid (m->data), NULL);
g_object_unref (comp);
}