[evolution] Fix clang warnings (mostly [-Wenum-conversion])



commit b9accbb6878036f644b806c7a80c80aa67fcbac8
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 21 18:32:28 2019 +0200

    Fix clang warnings (mostly [-Wenum-conversion])
    
    Related to https://gitlab.gnome.org/GNOME/evolution-data-server/issues/117

 src/calendar/gui/e-cal-dialogs.c                 |  6 +++---
 src/calendar/gui/e-cal-model-calendar.c          |  2 +-
 src/calendar/gui/e-cal-model-memos.c             |  2 +-
 src/calendar/gui/e-cal-model-tasks.c             | 22 +++++++++++-----------
 src/calendar/gui/e-cal-model.c                   | 18 +++++++++---------
 src/calendar/gui/e-cal-ops.c                     |  6 +++---
 src/calendar/gui/e-calendar-view.c               |  6 +++---
 src/calendar/gui/e-comp-editor-event.c           |  8 ++++----
 src/calendar/gui/e-comp-editor-page-recurrence.c |  6 +++---
 src/calendar/gui/e-comp-editor-property-parts.c  |  2 +-
 src/modules/itip-formatter/itip-view.c           |  6 +++---
 11 files changed, 42 insertions(+), 42 deletions(-)
---
diff --git a/src/calendar/gui/e-cal-dialogs.c b/src/calendar/gui/e-cal-dialogs.c
index b32c8eb7b5..68e3fae51b 100644
--- a/src/calendar/gui/e-cal-dialogs.c
+++ b/src/calendar/gui/e-cal-dialogs.c
@@ -291,19 +291,19 @@ e_cal_dialogs_copy_source (GtkWindow *parent,
        g_return_if_fail (E_IS_SOURCE (from_source));
 
        switch (e_cal_model_get_component_kind (model)) {
-               case ICAL_VEVENT_COMPONENT:
+               case I_CAL_VEVENT_COMPONENT:
                        obj_type = E_CAL_CLIENT_SOURCE_TYPE_EVENTS;
                        extension_name = E_SOURCE_EXTENSION_CALENDAR;
                        format = _("Copying events to the calendar “%s”");
                        alert_ident = "calendar:failed-copy-event";
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        obj_type = E_CAL_CLIENT_SOURCE_TYPE_MEMOS;
                        extension_name = E_SOURCE_EXTENSION_MEMO_LIST;
                        format = _("Copying memos to the memo list “%s”");
                        alert_ident = "calendar:failed-copy-memo";
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        obj_type = E_CAL_CLIENT_SOURCE_TYPE_TASKS;
                        extension_name = E_SOURCE_EXTENSION_TASK_LIST;
                        format = _("Copying tasks to the task list “%s”");
diff --git a/src/calendar/gui/e-cal-model-calendar.c b/src/calendar/gui/e-cal-model-calendar.c
index fe0d768a0f..74e6b5f106 100644
--- a/src/calendar/gui/e-cal-model-calendar.c
+++ b/src/calendar/gui/e-cal-model-calendar.c
@@ -523,7 +523,7 @@ static void
 e_cal_model_calendar_init (ECalModelCalendar *model)
 {
        e_cal_model_set_component_kind (
-               E_CAL_MODEL (model), ICAL_VEVENT_COMPONENT);
+               E_CAL_MODEL (model), I_CAL_VEVENT_COMPONENT);
 }
 
 ECalModel *
diff --git a/src/calendar/gui/e-cal-model-memos.c b/src/calendar/gui/e-cal-model-memos.c
index ce53e00987..058b3fb636 100644
--- a/src/calendar/gui/e-cal-model-memos.c
+++ b/src/calendar/gui/e-cal-model-memos.c
@@ -255,7 +255,7 @@ static void
 e_cal_model_memos_init (ECalModelMemos *model)
 {
        e_cal_model_set_component_kind (
-               E_CAL_MODEL (model), ICAL_VJOURNAL_COMPONENT);
+               E_CAL_MODEL (model), I_CAL_VJOURNAL_COMPONENT);
 }
 
 ECalModel *
diff --git a/src/calendar/gui/e-cal-model-tasks.c b/src/calendar/gui/e-cal-model-tasks.c
index 8cc5c09ecc..6e86ea0190 100644
--- a/src/calendar/gui/e-cal-model-tasks.c
+++ b/src/calendar/gui/e-cal-model-tasks.c
@@ -281,15 +281,15 @@ get_status (ECalModelComponent *comp_data)
                g_object_unref (prop);
 
                switch (status) {
-               case ICAL_STATUS_NONE:
+               case I_CAL_STATUS_NONE:
                        return (gpointer) "";
-               case ICAL_STATUS_NEEDSACTION:
+               case I_CAL_STATUS_NEEDSACTION:
                        return (gpointer) _("Not Started");
-               case ICAL_STATUS_INPROCESS:
+               case I_CAL_STATUS_INPROCESS:
                        return (gpointer) _("In Progress");
-               case ICAL_STATUS_COMPLETED:
+               case I_CAL_STATUS_COMPLETED:
                        return (gpointer) _("Completed");
-               case ICAL_STATUS_CANCELLED:
+               case I_CAL_STATUS_CANCELLED:
                        return (gpointer) _("Cancelled");
                default:
                        return (gpointer) "";
@@ -602,19 +602,19 @@ set_status (ECalModelComponent *comp_data,
        }
 
        switch (status) {
-       case ICAL_STATUS_NEEDSACTION:
+       case I_CAL_STATUS_NEEDSACTION:
                ensure_task_not_complete (comp_data, TRUE);
                break;
 
-       case ICAL_STATUS_INPROCESS:
+       case I_CAL_STATUS_INPROCESS:
                ensure_task_partially_complete (comp_data);
                break;
 
-       case ICAL_STATUS_CANCELLED:
+       case I_CAL_STATUS_CANCELLED:
                ensure_task_not_complete (comp_data, FALSE);
                break;
 
-       case ICAL_STATUS_COMPLETED:
+       case I_CAL_STATUS_COMPLETED:
                ensure_task_complete (comp_data, -1);
                break;
 
@@ -1304,7 +1304,7 @@ e_cal_model_tasks_init (ECalModelTasks *model)
        model->priv->highlight_overdue = TRUE;
 
        e_cal_model_set_component_kind (
-               E_CAL_MODEL (model), ICAL_VTODO_COMPONENT);
+               E_CAL_MODEL (model), I_CAL_VTODO_COMPONENT);
 }
 
 ECalModel *
@@ -1462,7 +1462,7 @@ e_cal_model_tasks_mark_comp_incomplete (ECalModelTasks *model,
        /* Status */
        prop = i_cal_component_get_first_property (comp_data->icalcomp, I_CAL_STATUS_PROPERTY);
        if (prop)
-               i_cal_property_set_status (prop, ICAL_STATUS_NEEDSACTION);
+               i_cal_property_set_status (prop, I_CAL_STATUS_NEEDSACTION);
        else
                i_cal_component_take_property (comp_data->icalcomp, i_cal_property_new_status 
(I_CAL_STATUS_NEEDSACTION));
        g_clear_object (&prop);
diff --git a/src/calendar/gui/e-cal-model.c b/src/calendar/gui/e-cal-model.c
index 5daa424dea..db252daec1 100644
--- a/src/calendar/gui/e-cal-model.c
+++ b/src/calendar/gui/e-cal-model.c
@@ -1323,11 +1323,11 @@ cal_model_kind_to_extension_name (ECalModel *model)
        g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL);
 
        switch (model->priv->kind) {
-               case ICAL_VEVENT_COMPONENT:
+               case I_CAL_VEVENT_COMPONENT:
                        return E_SOURCE_EXTENSION_CALENDAR;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        return E_SOURCE_EXTENSION_MEMO_LIST;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        return E_SOURCE_EXTENSION_TASK_LIST;
                default:
                        g_warn_if_reached ();
@@ -1508,15 +1508,15 @@ cal_model_append_row (ETableModel *etm,
        g_return_if_fail (E_IS_TABLE_MODEL (source));
 
        switch (e_cal_model_get_component_kind (model)) {
-               case ICAL_VEVENT_COMPONENT:
+               case I_CAL_VEVENT_COMPONENT:
                        description = _("Creating an event");
                        alert_ident = "calendar:failed-create-event";
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        description = _("Creating a memo");
                        alert_ident = "calendar:failed-create-memo";
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        description = _("Creating a task");
                        alert_ident = "calendar:failed-create-task";
                        break;
@@ -1591,14 +1591,14 @@ cal_model_value_at (ETableModel *etm,
                return (gpointer) get_dtstart (model, comp_data);
        case E_CAL_MODEL_FIELD_CREATED :
                return (gpointer) get_datetime_from_utc (
-                       model, comp_data, ICAL_CREATED_PROPERTY,
+                       model, comp_data, I_CAL_CREATED_PROPERTY,
                        i_cal_property_get_created, &comp_data->created);
        case E_CAL_MODEL_FIELD_LASTMODIFIED :
                return (gpointer) get_datetime_from_utc (
                        model, comp_data, I_CAL_LASTMODIFIED_PROPERTY,
                        i_cal_property_get_lastmodified, &comp_data->lastmodified);
        case E_CAL_MODEL_FIELD_HAS_ALARMS :
-               return GINT_TO_POINTER (e_cal_util_component_has_property (comp_data->icalcomp, 
I_CAL_VALARM_COMPONENT));
+               return GINT_TO_POINTER (e_cal_util_component_has_alarms (comp_data->icalcomp));
        case E_CAL_MODEL_FIELD_ICON :
        {
                ECalComponent *comp;
@@ -2613,7 +2613,7 @@ e_cal_model_init (ECalModel *model)
        model->priv->end = (time_t) -1;
 
        model->priv->objects = g_ptr_array_new ();
-       model->priv->kind = ICAL_NO_COMPONENT;
+       model->priv->kind = I_CAL_NO_COMPONENT;
 
        model->priv->use_24_hour_format = TRUE;
 }
diff --git a/src/calendar/gui/e-cal-ops.c b/src/calendar/gui/e-cal-ops.c
index 1949d37a5c..7afc052d14 100644
--- a/src/calendar/gui/e-cal-ops.c
+++ b/src/calendar/gui/e-cal-ops.c
@@ -1803,13 +1803,13 @@ e_cal_ops_new_component_editor_from_model (ECalModel *model,
        g_return_if_fail (E_IS_CAL_MODEL (model));
 
        switch (e_cal_model_get_component_kind (model)) {
-               case ICAL_VEVENT_COMPONENT:
+               case I_CAL_VEVENT_COMPONENT:
                        source_type = E_CAL_CLIENT_SOURCE_TYPE_EVENTS;
                        break;
-               case ICAL_VJOURNAL_COMPONENT:
+               case I_CAL_VJOURNAL_COMPONENT:
                        source_type = E_CAL_CLIENT_SOURCE_TYPE_MEMOS;
                        break;
-               case ICAL_VTODO_COMPONENT:
+               case I_CAL_VTODO_COMPONENT:
                        source_type = E_CAL_CLIENT_SOURCE_TYPE_TASKS;
                        break;
                default:
diff --git a/src/calendar/gui/e-calendar-view.c b/src/calendar/gui/e-calendar-view.c
index b354700e4f..00848dafec 100644
--- a/src/calendar/gui/e-calendar-view.c
+++ b/src/calendar/gui/e-calendar-view.c
@@ -1052,13 +1052,13 @@ calendar_view_paste_clipboard (ESelectable *selectable)
                const gchar *alert_ident = NULL;
 
                switch (e_cal_model_get_component_kind (model)) {
-                       case ICAL_VEVENT_COMPONENT:
+                       case I_CAL_VEVENT_COMPONENT:
                                alert_ident = "calendar:failed-create-event";
                                break;
-                       case ICAL_VJOURNAL_COMPONENT:
+                       case I_CAL_VJOURNAL_COMPONENT:
                                alert_ident = "calendar:failed-create-memo";
                                break;
-                       case ICAL_VTODO_COMPONENT:
+                       case I_CAL_VTODO_COMPONENT:
                                alert_ident = "calendar:failed-create-task";
                                break;
                        default:
diff --git a/src/calendar/gui/e-comp-editor-event.c b/src/calendar/gui/e-comp-editor-event.c
index bc0f245e79..abb7bca702 100644
--- a/src/calendar/gui/e-comp-editor-event.c
+++ b/src/calendar/gui/e-comp-editor-event.c
@@ -741,21 +741,21 @@ ece_event_setup_ui (ECompEditorEvent *event_editor)
                  N_("Pu_blic"),
                  NULL,
                  N_("Classify as public"),
-                 ICAL_CLASS_PUBLIC },
+                 I_CAL_CLASS_PUBLIC },
 
                { "classify-private",
                  NULL,
                  N_("_Private"),
                  NULL,
                  N_("Classify as private"),
-                 ICAL_CLASS_PRIVATE },
+                 I_CAL_CLASS_PRIVATE },
 
                { "classify-confidential",
                  NULL,
                  N_("_Confidential"),
                  NULL,
                  N_("Classify as confidential"),
-                 ICAL_CLASS_CONFIDENTIAL }
+                 I_CAL_CLASS_CONFIDENTIAL }
        };
 
        ECompEditor *comp_editor;
@@ -779,7 +779,7 @@ ece_event_setup_ui (ECompEditorEvent *event_editor)
        gtk_action_group_add_radio_actions (
                action_group, classification_radio_entries,
                G_N_ELEMENTS (classification_radio_entries),
-               ICAL_CLASS_PUBLIC,
+               I_CAL_CLASS_PUBLIC,
                G_CALLBACK (ece_event_action_classification_cb), event_editor);
 
        gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, &error);
diff --git a/src/calendar/gui/e-comp-editor-page-recurrence.c 
b/src/calendar/gui/e-comp-editor-page-recurrence.c
index 579617a6aa..703bba46a1 100644
--- a/src/calendar/gui/e-comp-editor-page-recurrence.c
+++ b/src/calendar/gui/e-comp-editor-page-recurrence.c
@@ -1205,7 +1205,7 @@ ecep_recurrence_clear_widgets (ECompEditorPageRecurrence *page_recurrence)
        g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
 
        g_signal_handlers_block_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
-       e_dialog_combo_box_set (page_recurrence->priv->recr_interval_unit_combo, ICAL_DAILY_RECURRENCE, 
freq_map);
+       e_dialog_combo_box_set (page_recurrence->priv->recr_interval_unit_combo, I_CAL_DAILY_RECURRENCE, 
freq_map);
        g_signal_handlers_unblock_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
 
        g_clear_object (&page_recurrence->priv->ending_date_tt);
@@ -1316,7 +1316,7 @@ ecep_recurrence_simple_recur_to_comp (ECompEditorPageRecurrence *page_recurrence
                break;
        }
 
-       case ICAL_MONTHLY_RECURRENCE: {
+       case I_CAL_MONTHLY_RECURRENCE: {
                enum month_num_options month_num;
                enum month_day_options month_day;
 
@@ -1795,7 +1795,7 @@ ecep_recurrence_fill_widgets (ECompEditorPage *page,
                g_signal_handlers_unblock_matched (page_recurrence->priv->recr_interval_unit_combo, 
G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page_recurrence);
                break;
 
-       case ICAL_YEARLY_RECURRENCE:
+       case I_CAL_YEARLY_RECURRENCE:
                if (n_by_day != 0
                    || n_by_month_day != 0
                    || n_by_year_day != 0
diff --git a/src/calendar/gui/e-comp-editor-property-parts.c b/src/calendar/gui/e-comp-editor-property-parts.c
index f2b8f58376..58b94aa40e 100644
--- a/src/calendar/gui/e-comp-editor-property-parts.c
+++ b/src/calendar/gui/e-comp-editor-property-parts.c
@@ -1191,7 +1191,7 @@ e_comp_editor_property_part_classification_new (void)
 
        e_comp_editor_property_part_picker_with_map_set_selected (
                E_COMP_EDITOR_PROPERTY_PART_PICKER_WITH_MAP (part),
-               classify_private ? ICAL_CLASS_PRIVATE : ICAL_CLASS_PUBLIC);
+               classify_private ? I_CAL_CLASS_PRIVATE : I_CAL_CLASS_PUBLIC);
 
        return part;
 }
diff --git a/src/modules/itip-formatter/itip-view.c b/src/modules/itip-formatter/itip-view.c
index 0492a19a02..badd3a8759 100644
--- a/src/modules/itip-formatter/itip-view.c
+++ b/src/modules/itip-formatter/itip-view.c
@@ -6280,7 +6280,7 @@ view_response_cb (ItipView *view,
                                        view->priv->registry,
                                        view->priv->ical_comp,
                                        view->priv->to_address,
-                                       ICAL_PARTSTAT_ACCEPTED);
+                                       I_CAL_PARTSTAT_ACCEPTED);
                        else
                                status = TRUE;
                        if (status) {
@@ -6292,7 +6292,7 @@ view_response_cb (ItipView *view,
                                        view->priv->registry,
                                        view->priv->ical_comp,
                                        view->priv->to_address,
-                                       ICAL_PARTSTAT_TENTATIVE);
+                                       I_CAL_PARTSTAT_TENTATIVE);
                        if (status) {
                                update_item (view, response);
                        }
@@ -6303,7 +6303,7 @@ view_response_cb (ItipView *view,
                                        view->priv->registry,
                                        view->priv->ical_comp,
                                        view->priv->to_address,
-                                       ICAL_PARTSTAT_DECLINED);
+                                       I_CAL_PARTSTAT_DECLINED);
                        else {
                                prop = i_cal_property_new_x ("1");
                                i_cal_property_set_x_name (prop, "X-GW-DECLINED");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]