aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-12-12 10:17:32 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-12-12 10:17:32 +0800
commit1de2b20cd497dbf35c96b162dace5a211f2bc679 (patch)
tree22d38893fef73b960854cde9f2536e13a83ca8a2 /calendar/gui/dialogs
parentcb96794cec2852c404677d969543c01bff8a3635 (diff)
downloadgsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.tar.gz
gsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.tar.zst
gsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.zip
This is to make things work with libical 0.21helix1 and later. Warnings
2000-12-11 Federico Mena Quintero <federico@helixcode.com> 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 <ical.h> instead of <icaltypes.h> * 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
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/task-editor.c48
1 files changed, 5 insertions, 43 deletions
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)