aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-model.c10
-rw-r--r--calendar/gui/dialogs/task-editor.c48
-rw-r--r--calendar/gui/e-itip-control.c1
-rw-r--r--calendar/gui/e-meeting-edit.c1
-rw-r--r--calendar/gui/itip-utils.h1
5 files changed, 8 insertions, 53 deletions
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index 8de4ab2e09..20c2bff234 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -1915,7 +1915,6 @@ ensure_task_complete (CalComponent *comp,
{
struct icaltimetype *old_completed = NULL;
struct icaltimetype new_completed;
- const char *old_status;
int *old_percent, new_percent;
gboolean set_completed = TRUE;
@@ -1945,9 +1944,6 @@ ensure_task_complete (CalComponent *comp,
}
if (old_percent)
cal_component_free_percent (old_percent);
-
- /* Status. */
- cal_component_get_status (comp, &old_status);
}
@@ -1958,7 +1954,7 @@ ensure_task_complete (CalComponent *comp,
static void
ensure_task_not_complete (CalComponent *comp)
{
- const char *old_status;
+ icalproperty_status old_status;
int *old_percent;
/* Date Completed. */
@@ -1973,8 +1969,8 @@ ensure_task_not_complete (CalComponent *comp)
/* Status. */
cal_component_get_status (comp, &old_status);
- if (old_status && !strcmp (old_status, "COMPLETED"))
- cal_component_set_status (comp, "NEEDS-ACTION");
+ if (old_status == ICAL_STATUS_COMPLETED)
+ cal_component_set_status (comp, ICAL_STATUS_NEEDSACTION);
}
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)
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index a19763344c..ced1431292 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -12,7 +12,6 @@
#include <gnome.h>
#include <bonobo.h>
#include <glade/glade.h>
-#include <icaltypes.h>
#include <ical.h>
#include <time.h>
#include <Evolution-Composer.h>
diff --git a/calendar/gui/e-meeting-edit.c b/calendar/gui/e-meeting-edit.c
index efe41bbf09..abff825a29 100644
--- a/calendar/gui/e-meeting-edit.c
+++ b/calendar/gui/e-meeting-edit.c
@@ -22,7 +22,6 @@
#include <config.h>
#include <gnome.h>
#include <glade/glade.h>
-#include <icaltypes.h>
#include <ical.h>
#include <widgets/meeting-time-sel/e-meeting-time-sel.h>
#include <Evolution-Composer.h>
diff --git a/calendar/gui/itip-utils.h b/calendar/gui/itip-utils.h
index 0d2b073e4f..146cb68154 100644
--- a/calendar/gui/itip-utils.h
+++ b/calendar/gui/itip-utils.h
@@ -3,7 +3,6 @@
#define ITIP_UTILS_HEADER
#include <config.h>
-#include <icaltypes.h>
#include <ical.h>
#include <string.h>
#include <gnome.h>