aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorSeth Alves <alves@src.gnome.org>2000-06-08 03:59:48 +0800
committerSeth Alves <alves@src.gnome.org>2000-06-08 03:59:48 +0800
commit35c55267f22a30cccd78e1f45efdd2e4b353fd94 (patch)
tree880acbc384eec12469bb2e8a41eae9c7dd997164 /calendar/gui
parentf0e9a692608d04c14f2060f32b18c91bf8b2982d (diff)
downloadgsoc2013-evolution-35c55267f22a30cccd78e1f45efdd2e4b353fd94.tar
gsoc2013-evolution-35c55267f22a30cccd78e1f45efdd2e4b353fd94.tar.gz
gsoc2013-evolution-35c55267f22a30cccd78e1f45efdd2e4b353fd94.tar.bz2
gsoc2013-evolution-35c55267f22a30cccd78e1f45efdd2e4b353fd94.tar.lz
gsoc2013-evolution-35c55267f22a30cccd78e1f45efdd2e4b353fd94.tar.xz
gsoc2013-evolution-35c55267f22a30cccd78e1f45efdd2e4b353fd94.tar.zst
gsoc2013-evolution-35c55267f22a30cccd78e1f45efdd2e4b353fd94.zip
instead of returning a text representation, decode the text and return an
* cal-client/cal-client.c (cal_client_get_object): instead of returning a text representation, decode the text and return an iCalObject. Also added CalClientGetStatus which indicates success or type of failure. * cal-util/calobj.c (ical_object_find_in_string): #ifed out ical_object_find_in_string since it is unused now. * cal-client/client-test.c (list_uids): track get_object change * gui/calendar-commands.c (calendar_iterate): same * gui/e-day-view.c (e_day_view_update_event): same * gui/e-week-view.c (e_week_view_update_event): same * gui/print.c (print_day_details): same (print_day_summary): same (print_todo_details): same * gui/gnome-cal.c (trigger_alarm_cb): same * gui/gncal-todo.c (gncal_todo_update): same svn path=/trunk/; revision=3463
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-commands.c29
-rw-r--r--calendar/gui/e-day-view.c13
-rw-r--r--calendar/gui/e-week-view.c13
-rw-r--r--calendar/gui/gncal-todo.c22
-rw-r--r--calendar/gui/gnome-cal.c22
-rw-r--r--calendar/gui/print.c69
6 files changed, 51 insertions, 117 deletions
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index 49bb023875..0a4d12f93a 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -383,15 +383,15 @@ show_month_view_clicked (BonoboUIHandler *uih, void *user_data, const char *path
gtk_widget_grab_focus (gcal->month_view);
}
+#if 0
static void
show_year_view_clicked (BonoboUIHandler *uih, void *user_data, const char *path)
{
-#if 0
GnomeCalendar *gcal = GNOME_CALENDAR (user_data);
gnome_calendar_set_view (gcal, "yearview");
gtk_widget_grab_focus (gcal->year_view);
-#endif
}
+#endif
static void
new_calendar_cmd (BonoboUIHandler *uih, void *user_data, const char *path)
@@ -893,9 +893,9 @@ calendar_iterate (GnomeCalendar *cal,
{
GList *l, *cois;
GHashTable *cache;
- CalObjFindStatus status;
+ CalClientGetStatus status;
CalObjInstance *coi;
- char *uid, *obj_string;
+ char *uid;
iCalObject *ico;
cois = cal_client_get_events_in_range (cal->client, start, end);
@@ -910,26 +910,17 @@ calendar_iterate (GnomeCalendar *cal,
ico = g_hash_table_lookup (cache, uid);
if (!ico) {
- obj_string = cal_client_get_object (cal->client, uid);
-
- status = ical_object_find_in_string (uid, obj_string,
- &ico);
- g_free (obj_string);
+ status = cal_client_get_object (cal->client, uid, &ico);
switch (status) {
- case CAL_OBJ_FIND_SUCCESS:
+ case CAL_CLIENT_GET_SUCCESS:
g_hash_table_insert (cache, ico->uid, ico);
-
break;
- case CAL_OBJ_FIND_SYNTAX_ERROR:
- printf ("calendar_iterate: syntax error uid=%s\n",
- uid);
- ico = NULL;
+ case CAL_CLIENT_GET_SYNTAX_ERROR:
+ printf ("calendar_iterate: syntax error uid=%s\n", uid);
break;
- case CAL_OBJ_FIND_NOT_FOUND:
- printf ("calendar_iterate: obj not found uid=%s\n",
- uid);
- ico = NULL;
+ case CAL_CLIENT_GET_NOT_FOUND:
+ printf ("calendar_iterate: obj not found uid=%s\n", uid);
break;
}
}
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index fde159dab1..8508d08a56 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -1085,9 +1085,8 @@ e_day_view_update_event (EDayView *day_view,
const gchar *uid)
{
EDayViewEvent *event;
- gchar *obj_string;
iCalObject *ico;
- CalObjFindStatus status;
+ CalClientGetStatus status;
gint day, event_num;
g_return_if_fail (E_IS_DAY_VIEW (day_view));
@@ -1107,18 +1106,16 @@ e_day_view_update_event (EDayView *day_view,
return;
/* Get the event from the server. */
- obj_string = cal_client_get_object (day_view->calendar->client, uid);
- status = ical_object_find_in_string (uid, obj_string, &ico);
- g_free (obj_string);
+ status = cal_client_get_object (day_view->calendar->client, uid, &ico);
switch (status) {
- case CAL_OBJ_FIND_SUCCESS:
+ case CAL_CLIENT_GET_SUCCESS:
/* Do nothing. */
break;
- case CAL_OBJ_FIND_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_SYNTAX_ERROR:
g_warning ("syntax error uid=%s\n", uid);
return;
- case CAL_OBJ_FIND_NOT_FOUND:
+ case CAL_CLIENT_GET_NOT_FOUND:
g_warning ("obj not found uid=%s\n", uid);
return;
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index c09d3fc541..7f5eb7b15f 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -966,9 +966,8 @@ e_week_view_update_event (EWeekView *week_view,
{
EWeekViewEvent *event;
gint event_num, num_days;
- gchar *obj_string;
iCalObject *ico;
- CalObjFindStatus status;
+ CalClientGetStatus status;
g_return_if_fail (E_IS_WEEK_VIEW (week_view));
@@ -982,18 +981,16 @@ e_week_view_update_event (EWeekView *week_view,
return;
/* Get the event from the server. */
- obj_string = cal_client_get_object (week_view->calendar->client, uid);
- status = ical_object_find_in_string (uid, obj_string, &ico);
- g_free (obj_string);
+ status = cal_client_get_object (week_view->calendar->client, uid, &ico);
switch (status) {
- case CAL_OBJ_FIND_SUCCESS:
+ case CAL_CLIENT_GET_SUCCESS:
/* Do nothing. */
break;
- case CAL_OBJ_FIND_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_SYNTAX_ERROR:
g_warning ("syntax error uid=%s\n", uid);
return;
- case CAL_OBJ_FIND_NOT_FOUND:
+ case CAL_CLIENT_GET_NOT_FOUND:
g_warning ("obj not found uid=%s\n", uid);
return;
}
diff --git a/calendar/gui/gncal-todo.c b/calendar/gui/gncal-todo.c
index 1f7fd3bb59..e3c25b9e53 100644
--- a/calendar/gui/gncal-todo.c
+++ b/calendar/gui/gncal-todo.c
@@ -800,8 +800,7 @@ void
gncal_todo_update (GncalTodo *todo, iCalObject *ico, int flags)
{
GSList *current_list;
-
- CalObjFindStatus st;
+ CalClientGetStatus status;
GList *l, *uids;
g_return_if_fail (todo != NULL);
@@ -864,15 +863,16 @@ gncal_todo_update (GncalTodo *todo, iCalObject *ico, int flags)
CALOBJ_TYPE_TODO);
for (l = uids; l; l = l->next){
char *uid = l->data;
- char *obj_string =
- cal_client_get_object (todo->calendar->client, uid);
- iCalObject *obj = NULL;
-
- st = ical_object_find_in_string (uid, obj_string, &obj);
- g_free (obj_string);
-
- insert_in_clist (todo, obj);
- ical_object_unref (obj);
+ iCalObject *obj;
+
+ status = cal_client_get_object (todo->calendar->client, uid, &ico);
+
+ if (status == CAL_CLIENT_GET_SUCCESS) {
+ insert_in_clist (todo, obj);
+ ical_object_unref (obj);
+ }
+#warning "FIX ME"
+ /* else? */
g_free (uid);
}
g_list_free (uids);
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index e6e7082666..6f05c7ec60 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -619,9 +619,8 @@ static void
trigger_alarm_cb (gpointer alarm_id, time_t trigger, gpointer data)
{
struct trigger_alarm_closure *c;
- char *str_ico;
iCalObject *ico;
- CalObjFindStatus status;
+ CalClientGetStatus status;
ObjectAlarms *oa;
GList *l;
@@ -629,27 +628,16 @@ trigger_alarm_cb (gpointer alarm_id, time_t trigger, gpointer data)
/* Fetch the object */
- str_ico = cal_client_get_object (c->gcal->client, c->uid);
- if (!str_ico) {
- g_message ("trigger_alarm_cb(): could not fetch object `%s'", c->uid);
- return;
- }
-
- status = ical_object_find_in_string (c->uid, str_ico, &ico);
- g_free (str_ico);
+ status = cal_client_get_object (c->gcal->client, c->uid, &ico);
switch (status) {
- case CAL_OBJ_FIND_SUCCESS:
+ case CAL_CLIENT_GET_SUCCESS:
/* Go on */
break;
-
- case CAL_OBJ_FIND_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_NOT_FOUND:
g_message ("trigger_alarm_cb(): syntax error in fetched object");
return;
-
- case CAL_OBJ_FIND_NOT_FOUND:
- g_message ("trigger_alarm_cb(): could not find fetched object");
- return;
}
g_assert (ico != NULL);
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 436221ebc6..3b4f2c4a18 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -567,33 +567,20 @@ print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
for (i = 0, l = events; l != NULL; l = l->next, i++) {
CalObjInstance *coi;
- char *str_ico;
iCalObject *ico;
- CalObjFindStatus status;
+ CalClientGetStatus status;
coi = l->data;
- str_ico = cal_client_get_object (gcal->client, coi->uid);
-
- if (!str_ico) {
- /* The object could have disappeared from the server */
- continue;
- }
-
- status = ical_object_find_in_string (coi->uid, str_ico, &ico);
- g_free (str_ico);
+ status = cal_client_get_object (gcal->client, coi->uid, &ico);
switch (status) {
- case CAL_OBJ_FIND_SUCCESS:
+ case CAL_CLIENT_GET_SUCCESS:
/* Go on */
break;
-
- case CAL_OBJ_FIND_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_NOT_FOUND:
g_message ("print_day_details(): syntax error in fetched object");
continue;
-
- case CAL_OBJ_FIND_NOT_FOUND:
- g_message ("print_day_details(): could not find fetched object");
- continue;
}
y = top - (top - bottom) * (coi->start - start) / (end - start) - 1;
@@ -676,33 +663,20 @@ print_day_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
for (i=0, l = events; l != NULL; l = l->next, i++) {
CalObjInstance *coi;
- char *str_ico;
iCalObject *ico;
- CalObjFindStatus status;
+ CalClientGetStatus status;
coi = l->data;
- str_ico = cal_client_get_object (gcal->client, coi->uid);
-
- if (!str_ico) {
- /* The object could have disappeared from the server */
- continue;
- }
-
- status = ical_object_find_in_string (coi->uid, str_ico, &ico);
- g_free (str_ico);
+ status = cal_client_get_object (gcal->client, coi->uid, &ico);
switch (status) {
- case CAL_OBJ_FIND_SUCCESS:
+ case CAL_CLIENT_GET_SUCCESS:
/* Go on */
break;
-
- case CAL_OBJ_FIND_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_NOT_FOUND:
g_message ("print_day_summary(): syntax error in fetched object");
continue;
-
- case CAL_OBJ_FIND_NOT_FOUND:
- g_message ("print_day_summary(): could not find fetched object");
- continue;
}
x = left + incsmall;
@@ -898,32 +872,19 @@ print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t start, ti
yend = bottom - 2;
for (i = 0, l = todos; l != NULL; l = l->next, i++) {
- char *str_ico;
iCalObject *ico;
- CalObjFindStatus status;
-
- str_ico = cal_client_get_object (gcal->client, l->data);
-
- if (!str_ico) {
- /* The object could have disappeared from the server */
- continue;
- }
+ CalClientGetStatus status;
- status = ical_object_find_in_string (l->data, str_ico, &ico);
- g_free (str_ico);
+ status = cal_client_get_object (gcal->client, l->data, &ico);
switch (status) {
- case CAL_OBJ_FIND_SUCCESS:
+ case CAL_CLIENT_GET_SUCCESS:
/* Go on */
break;
-
- case CAL_OBJ_FIND_SYNTAX_ERROR:
+ case CAL_CLIENT_GET_NOT_FOUND:
+ case CAL_CLIENT_GET_SYNTAX_ERROR:
g_message ("print_todo_details(): syntax error in fetched object");
continue;
-
- case CAL_OBJ_FIND_NOT_FOUND:
- g_message ("print_todo_details(): could not find fetched object");
- continue;
}
x = left;