From 1de2b20cd497dbf35c96b162dace5a211f2bc679 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 12 Dec 2000 02:17:32 +0000 Subject: This is to make things work with libical 0.21helix1 and later. Warnings 2000-12-11 Federico Mena Quintero This is to make things work with libical 0.21helix1 and later. Warnings remain because at last libical was constified; will take care of those tomorrow. * cal-util/timeutil.h: #include instead of * gui/e-itip-control.c: Likewise. * gui/e-meeting-edit.c: Likewise. * gui/itip-utils.h: Likewise. * cal-util/cal-component.c (alarm_uid_from_prop): constify. (cal_component_get_status): Updated for new libical API. (cal_component_set_status): Likewise. * gui/calendar-model.c (ensure_task_complete): Removed unused status code. (ensure_task_not_complete): Update for new status API. * gui/dialogs/task-editor.c (status_string_to_value): Removed function. (status_value_to_string): Removed function. (status_string_map): Removed variable. (fill_widgets): Update for new status API. (dialog_to_comp_object): Likewise. svn path=/trunk/; revision=6932 --- calendar/gui/dialogs/task-editor.c | 48 ++++---------------------------------- 1 file changed, 5 insertions(+), 43 deletions(-) (limited to 'calendar/gui/dialogs') diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 211c31321a..6114ffa529 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -161,9 +161,6 @@ static void raise_and_focus (GtkWidget *widget); static TaskEditorPriority priority_value_to_index (int priority_value); static int priority_index_to_value (TaskEditorPriority priority); -static int status_string_to_value (const char *status_string); -static const char* status_value_to_string (int status); - static void completed_changed (EDateEdit *dedit, TaskEditor *tedit); static void status_changed (GtkMenu *menu, @@ -744,7 +741,7 @@ fill_widgets (TaskEditor *tedit) int *priority_value, *percent; icalproperty_status status; TaskEditorPriority priority; - const char *url, *status_string; + const char *url; priv = tedit->priv; @@ -810,10 +807,8 @@ fill_widgets (TaskEditor *tedit) } /* Status. */ - cal_component_get_status (priv->comp, &status_string); - if (status_string) { - status = status_string_to_value (status_string); - } else { + cal_component_get_status (priv->comp, &status); + if (status == ICAL_STATUS_NONE) { /* Try to user the percent value. */ if (percent) { if (*percent == 0) @@ -822,9 +817,8 @@ fill_widgets (TaskEditor *tedit) status = ICAL_STATUS_COMPLETED; else status = ICAL_STATUS_INPROCESS; - } else { + } else status = ICAL_STATUS_NEEDSACTION; - } } e_dialog_option_menu_set (priv->status, status, status_map); @@ -892,7 +886,6 @@ dialog_to_comp_object (TaskEditor *tedit) int priority_value, percent; CalComponentClassification classification; char *url; - const char *status_string; char *str; priv = tedit->priv; @@ -975,8 +968,7 @@ dialog_to_comp_object (TaskEditor *tedit) /* Status. */ status = e_dialog_option_menu_get (priv->status, status_map); - status_string = status_value_to_string (status); - cal_component_set_status (comp, status_string); + cal_component_set_status (comp, status); /* Priority. */ priority = e_dialog_option_menu_get (priv->priority, priority_map); @@ -1117,36 +1109,6 @@ priority_index_to_value (TaskEditorPriority priority) } -static int -status_string_to_value (const char *status_string) -{ - int i; - - for (i = 0; status_map[i] != -1; i++) { - if (!strcmp (status_string_map[i], status_string)) - return status_map[i]; - } - - g_warning ("Invalid todo status string"); - return ICAL_STATUS_NEEDSACTION; -} - - -static const char* -status_value_to_string (int status) -{ - int i; - - for (i = 0; status_map[i] != -1; i++) { - if (status_map[i] == status) - return status_string_map[i]; - } - - g_warning ("Invalid todo status value"); - return NULL; -} - - static void completed_changed (EDateEdit *dedit, TaskEditor *tedit) -- cgit v1.2.3