From 48ff93b64492c08d82e8452cb6b0e94b8582eb3e Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 28 Aug 2000 23:27:51 +0000 Subject: New function. We need this from code that dynamically updates from a 2000-08-28 Federico Mena Quintero * cal-client/cal-client.c (cal_client_is_loaded): New function. We need this from code that dynamically updates from a client and could not have connected to the "cal_loaded" signal right after the client was created. * gui/calendar-model.c (load_objects): Do not try to load the objects if the client has not been loaded yet. (cal_loaded_cb): Check the status value. * gui/calendar-model.h (CalendarModel): Declare the private structure here so that gdb will give me love. * pcs/cal-factory.h (CalFactory): Likewise. * pcs/cal.h (Cal): Likewise. * cal-client/cal-listener.h (CalListener): Likewise. * cal-client/cal-client.h (CalClient): Likewise. * pcs/cal-backend.h (CalBackend): This no longer has a private structure, so remove it. * cal-util/Makefile.am (libcal_util_la_SOURCES): Removed the vCalendar and old iCalendar cruft. (libcal_utilinclude_HEADERS): Likewise. Removed the obsolete iCalendar test program. svn path=/trunk/; revision=5091 --- calendar/gui/calendar-model.c | 12 +++++++++--- calendar/gui/calendar-model.h | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c index 135f770863..8a6eae5445 100644 --- a/calendar/gui/calendar-model.c +++ b/calendar/gui/calendar-model.c @@ -39,7 +39,7 @@ /* Private part of the ECalendarModel structure */ -typedef struct { +struct _CalendarModelPrivate { /* Calendar client we are using */ CalClient *client; @@ -54,7 +54,7 @@ typedef struct { /* HACK: so that ETable can do its stupid append_row() thing */ guint appending_row : 1; -} CalendarModelPrivate; +}; @@ -1443,7 +1443,10 @@ cal_loaded_cb (CalClient *client, g_return_if_fail (IS_CALENDAR_MODEL (model)); e_table_model_pre_change (E_TABLE_MODEL (model)); - load_objects (model); + + if (status == CAL_CLIENT_LOAD_SUCCESS) + load_objects (model); + e_table_model_changed (E_TABLE_MODEL (model)); } @@ -1620,6 +1623,9 @@ load_objects (CalendarModel *model) priv = model->priv; + if (!cal_client_is_loaded (priv->client)) + return; + uids = cal_client_get_uids (priv->client, priv->type); for (l = uids; l; l = l->next) { diff --git a/calendar/gui/calendar-model.h b/calendar/gui/calendar-model.h index d1481a4ece..aeb50b45e6 100644 --- a/calendar/gui/calendar-model.h +++ b/calendar/gui/calendar-model.h @@ -40,11 +40,13 @@ BEGIN_GNOME_DECLS typedef struct _CalendarModel CalendarModel; typedef struct _CalendarModelClass CalendarModelClass; +typedef struct _CalendarModelPrivate CalendarModelPrivate; + struct _CalendarModel { ETableModel model; /* Private data */ - gpointer priv; + CalendarModelPrivate *priv; }; struct _CalendarModelClass { -- cgit v1.2.3