diff options
55 files changed, 312 insertions, 680 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 17cc224656..e50801f77e 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,164 @@ +2006-01-09 Kjartan Maraas <kmaraas@gnome.org> + + * gui/alarm-notify/alarm-notify-dialog.c: + (add_alarm_to_notified_alarms_dialog): + * gui/alarm-notify/alarm-queue.c: (remove_queued_alarm), + (open_alarm_dialog), (menu_item_toggle_callback), (populate): + * gui/alarm-notify/alarm.c: (pop_alarm), (alarm_remove): + * gui/alarm-notify/config-data.c: + (config_data_replace_string_list): + * gui/cal-search-bar.c: (regen_query): + * gui/calendar-view-factory.c: + * gui/calendar-view.c: + * gui/comp-editor-factory.c: (edit_existing), + (resolve_pending_requests), (impl_editExisting), (impl_editNew): + * gui/control-factory.c: + * gui/dialogs/cal-attachment-select-file.c: + (comp_editor_select_file_attachments): + * gui/dialogs/calendar-setup.c: (eccp_get_source_type): + * gui/dialogs/comp-editor.c: (comp_editor_class_init), + (commit_all_fields), (delete_event_cb), (editor_key_press_event), + (menu_file_save_cb), (menu_file_close_cb), (make_icon_from_comp), + (comp_editor_focus), (needs_send_cb): + * gui/dialogs/delete-comp.c: (delete_component_dialog): + * gui/dialogs/e-delegate-dialog.c: + * gui/dialogs/event-editor.c: + * gui/dialogs/event-page.c: (event_page_fill_widgets), + (popup_delete_cb), (list_key_press): + * gui/dialogs/meeting-page.c: (remove_clicked_cb), + (popup_delete_cb), (button_press_event), (list_key_press), + (meeting_page_construct): + * gui/dialogs/memo-editor.c: (init_widgets), + (memo_editor_set_e_cal), (memo_editor_edit_comp), + (memo_editor_send_comp): + * gui/dialogs/memo-page.c: + * gui/dialogs/recurrence-page.c: (fill_exception_widgets), + (exception_add_cb): + * gui/dialogs/schedule-page.c: (clear_widgets), + (schedule_page_fill_component): + * gui/dialogs/task-details-page.c: + (task_details_page_fill_timezones), (complete_date_changed): + * gui/dialogs/task-editor.c: + * gui/dialogs/task-page.c: (task_page_fill_widgets), + (popup_delete_cb), (list_key_press): + * gui/e-alarm-list.c: (get_alarm_string): + * gui/e-cal-component-memo-preview.c: (write_html): + * gui/e-cal-component-preview.c: (write_html): + * gui/e-cal-list-view-config.c: + (e_cal_list_view_config_set_property), + (e_cal_list_view_config_get_property), + (e_cal_list_view_config_dispose): + * gui/e-cal-list-view.c: + * gui/e-cal-model-calendar.c: (ecmc_value_at): + * gui/e-cal-model-memos.c: (ecmm_value_at): + * gui/e-cal-model-tasks.c: (get_due_status), (ecmt_value_at), + (ecmt_set_value_at), (ecmt_is_cell_editable), + (ecmt_value_is_empty), (e_cal_model_tasks_mark_task_complete), + (e_cal_model_tasks_update_due_tasks): + * gui/e-cal-model.c: (get_classification), + (ecm_get_color_for_component), (e_cal_model_set_default_client), + (e_cal_view_objects_modified_cb), (e_cal_model_add_client), + (e_cal_model_remove_client), (e_cal_model_set_instance_times): + * gui/e-cal-popup.c: (ecalp_part_popup_saveas): + * gui/e-calendar-table-config.c: + (e_calendar_table_config_set_property), + (e_calendar_table_config_get_property), + (e_calendar_table_config_dispose): + * gui/e-calendar-table.c: (e_calendar_table_class_init): + * gui/e-calendar-table.h: + * gui/e-calendar-view.c: (e_calendar_view_set_property), + (e_calendar_view_get_property), (open_event_with_flags), + (e_calendar_view_get_tooltips): + * gui/e-cell-date-edit-config.c: + (e_cell_date_edit_config_set_property), + (e_cell_date_edit_config_get_property), + (e_cell_date_edit_config_dispose): + * gui/e-cell-date-edit-text.c: + * gui/e-comp-editor-registry.c: + * gui/e-date-edit-config.c: (e_date_edit_config_set_property), + (e_date_edit_config_get_property), (e_date_edit_config_dispose): + * gui/e-day-view-config.c: (e_day_view_config_set_property), + (e_day_view_config_get_property), (e_day_view_config_dispose): + * gui/e-day-view-main-item.c: (e_day_view_main_item_set_arg), + (e_day_view_main_item_draw_day_event), + (e_day_view_main_item_event): + * gui/e-day-view-time-item.c: (e_day_view_time_item_set_arg), + (e_day_view_time_item_get_column_width): + * gui/e-day-view-top-item.c: (e_day_view_top_item_set_arg), + (e_day_view_top_item_draw_long_event), + (e_day_view_top_item_draw_triangle), (e_day_view_top_item_event): + * gui/e-day-view.c: (process_component), (e_day_view_style_set), + (e_day_view_recalc_cell_sizes), (e_day_view_foreach_event), + (e_day_view_reshape_resize_long_event_rect_item), + (e_day_view_update_long_event_resize), (e_day_view_update_resize), + (e_day_view_reshape_long_event), (e_day_view_reshape_day_event), + (e_day_view_change_duration_to_start_of_work_day), + (tooltip_destroy), (e_day_view_on_text_item_event), + (e_day_view_on_editing_stopped): + * gui/e-itip-control.c: (e_itip_control_class_init), + (find_cal_opened_cb), (find_server), (set_date_label), + (ok_clicked_cb): + * gui/e-meeting-attendee.c: + * gui/e-meeting-list-view.c: + (e_meeting_list_view_remove_attendee_from_name_selector): + * gui/e-meeting-store.c: (role_to_text), (partstat_to_text), + (e_meeting_store_set_value): + * gui/e-meeting-time-sel-item.c: + (e_meeting_time_selector_item_set_arg), + (e_meeting_time_selector_item_paint_all_attendees_busy_periods): + * gui/e-meeting-time-sel.c: (e_meeting_time_selector_construct), + (e_meeting_time_selector_recalc_date_format): + * gui/e-memo-table-config.c: (e_memo_table_config_set_property), + (e_memo_table_config_get_property), (e_memo_table_config_dispose): + * gui/e-memo-table.c: (e_memo_table_class_init), (task_compare_cb): + * gui/e-memos.c: (update_view), (backend_error_cb), (open_ecal): + * gui/e-mini-calendar-config.c: + (e_mini_calendar_config_set_property), + (e_mini_calendar_config_get_property), + (e_mini_calendar_config_dispose): + * gui/e-pub-utils.c: (is_publish_time), (e_pub_publish): + * gui/e-tasks.c: (process_completed_tasks), (backend_error_cb): + * gui/e-timezone-entry.c: (e_timezone_entry_destroy): + * gui/e-week-view-config.c: (e_week_view_config_set_property), + (e_week_view_config_get_property), (e_week_view_config_dispose): + * gui/e-week-view-event-item.c: (e_week_view_event_item_draw), + (e_week_view_event_item_draw_icons): + * gui/e-week-view-main-item.c: (e_week_view_main_item_set_arg): + * gui/e-week-view-titles-item.c: (e_week_view_titles_item_set_arg), + (e_week_view_titles_item_draw): + * gui/e-week-view.c: (process_component), (tooltip_destroy), + (tooltip_event_cb), (e_week_view_reshape_event_span), + (e_week_view_on_text_item_event), (e_week_view_event_move), + (e_week_view_on_editing_stopped), (e_week_view_do_key_press): + * gui/gnome-cal.c: (dn_e_cal_view_objects_modified_cb), + (dn_e_cal_view_done_cb), (table_selection_change_cb), + (gnome_calendar_goto), (focus_current_view), (backend_error_cb), + (gnome_calendar_set_selected_time_range), + (gnome_calendar_get_current_time_range), + (gnome_calendar_get_visible_time_range), + (gnome_calendar_delete_selected_occurrence): + * gui/goto.c: (goto_dialog): + * gui/itip-utils.c: (comp_fb_normalize): + * gui/memos-component.c: (create_new_memo), + (impl_requestCreateItem): + * gui/migration.c: (migrate_memos): + * gui/print.c: (print_month_small), (print_day_details), + (print_todo_details), (print_comp_item): + * gui/tasks-component.c: (create_new_todo), + (impl_requestCreateItem): + * gui/weekday-picker.c: Cleanups: + - remove unused vars + - remove extraneous semi-colons + - add some comments where assignments were done without using + the results later + - remove break; statements after return foo; + - add casts in some places to be more type correct + - rename variables with name clashes + - s/if/ifdef in some cases + - mark some code static + - remove some unused functions + - use guint for 1-bit bitfields + 2006-02-01 Johnny Jacob <johnnyjacob@gmail.com> ** Fixes #326997 diff --git a/calendar/gui/cal-search-bar.c b/calendar/gui/cal-search-bar.c index de4ef659c0..ba199049da 100644 --- a/calendar/gui/cal-search-bar.c +++ b/calendar/gui/cal-search-bar.c @@ -77,7 +77,7 @@ enum { static guint cal_search_bar_signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (CalSearchBar, cal_search_bar, E_SEARCH_BAR_TYPE); +G_DEFINE_TYPE (CalSearchBar, cal_search_bar, E_SEARCH_BAR_TYPE) /* Class initialization function for the calendar search bar */ static void @@ -268,12 +268,9 @@ notify_category_is (CalSearchBar *cal_search) static void regen_query (CalSearchBar *cal_search) { - CalSearchBarPrivate *priv; int id; const char *category; - priv = cal_search->priv; - /* Fetch the data from the ESearchBar's entry widgets */ id = e_search_bar_get_item_id (E_SEARCH_BAR (cal_search)); diff --git a/calendar/gui/calendar-view-factory.c b/calendar/gui/calendar-view-factory.c index 2fced5476c..53d48e5478 100644 --- a/calendar/gui/calendar-view-factory.c +++ b/calendar/gui/calendar-view-factory.c @@ -43,7 +43,7 @@ static const char *calendar_view_factory_get_title (GalViewFactory *factory); static const char *calendar_view_factory_get_type_code (GalViewFactory *factory); static GalView *calendar_view_factory_new_view (GalViewFactory *factory, const char *name); -G_DEFINE_TYPE (CalendarViewFactory, calendar_view_factory, GAL_VIEW_FACTORY_TYPE); +G_DEFINE_TYPE (CalendarViewFactory, calendar_view_factory, GAL_VIEW_FACTORY_TYPE) /* Class initialization function for the calendar view factory */ static void diff --git a/calendar/gui/calendar-view.c b/calendar/gui/calendar-view.c index e3e39ea555..cc16850cf0 100644 --- a/calendar/gui/calendar-view.c +++ b/calendar/gui/calendar-view.c @@ -46,7 +46,7 @@ static void calendar_view_set_title (GalView *view, const char *title); static const char *calendar_view_get_type_code (GalView *view); static GalView *calendar_view_clone (GalView *view); -G_DEFINE_TYPE (CalendarView, calendar_view, GAL_VIEW_TYPE); +G_DEFINE_TYPE (CalendarView, calendar_view, GAL_VIEW_TYPE) /* Class initialization function for the calendar view */ static void diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c index 6a69cb48c9..323b66d5d1 100644 --- a/calendar/gui/comp-editor-factory.c +++ b/calendar/gui/comp-editor-factory.c @@ -111,7 +111,7 @@ static BonoboObjectClass *parent_class = NULL; BONOBO_TYPE_FUNC_FULL (CompEditorFactory, GNOME_Evolution_Calendar_CompEditorFactory, BONOBO_OBJECT_TYPE, - comp_editor_factory); + comp_editor_factory) /* Class initialization function for the component editor factory */ static void @@ -245,7 +245,7 @@ edit_existing (OpenClient *oc, const char *uid) icalcomponent *icalcomp; CompEditor *editor; ECalComponentVType vtype; - CompEditorFlags flags; + CompEditorFlags flags = { 0, }; g_assert (oc->open); @@ -353,14 +353,9 @@ edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompE static void resolve_pending_requests (OpenClient *oc) { - CompEditorFactory *factory; - CompEditorFactoryPrivate *priv; GSList *l; icaltimezone *zone; - factory = oc->factory; - priv = factory->priv; - if (!oc->pending) return; @@ -554,13 +549,11 @@ impl_editExisting (PortableServer_Servant servant, CORBA_Environment *ev) { CompEditorFactory *factory; - CompEditorFactoryPrivate *priv; OpenClient *oc; CompEditor *editor; ECalSourceType source_type; factory = COMP_EDITOR_FACTORY (bonobo_object_from_servant (servant)); - priv = factory->priv; switch (corba_type) { case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO: @@ -611,12 +604,10 @@ impl_editNew (PortableServer_Servant servant, CORBA_Environment *ev) { CompEditorFactory *factory; - CompEditorFactoryPrivate *priv; OpenClient *oc; ECalSourceType source_type; factory = COMP_EDITOR_FACTORY (bonobo_object_from_servant (servant)); - priv = factory->priv; switch (corba_type) { case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO: diff --git a/calendar/gui/control-factory.c b/calendar/gui/control-factory.c index c6aab4b258..8df9559ea1 100644 --- a/calendar/gui/control-factory.c +++ b/calendar/gui/control-factory.c @@ -38,6 +38,7 @@ #include "control-factory.h" +/* Are these supposed to be global or static? */ CORBA_Environment ev; CORBA_ORB orb; diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c index 9eb5f2db34..8cfbaaa366 100644 --- a/calendar/gui/e-alarm-list.c +++ b/calendar/gui/e-alarm-list.c @@ -436,11 +436,8 @@ get_alarm_string (ECalComponentAlarm *alarm) { ECalComponentAlarmAction action; ECalComponentAlarmTrigger trigger; - char string[256]; char *base, *str = NULL, *dur; - string [0] = '\0'; - e_cal_component_alarm_get_action (alarm, &action); e_cal_component_alarm_get_trigger (alarm, &trigger); diff --git a/calendar/gui/e-cal-component-memo-preview.c b/calendar/gui/e-cal-component-memo-preview.c index fd7d79dc00..7cb23740ce 100644 --- a/calendar/gui/e-cal-component-memo-preview.c +++ b/calendar/gui/e-cal-component-memo-preview.c @@ -45,7 +45,7 @@ struct _ECalComponentMemoPreviewPrivate { icaltimezone *zone; }; -G_DEFINE_TYPE (ECalComponentMemoPreview, e_cal_component_memo_preview, GTK_TYPE_TABLE); +G_DEFINE_TYPE (ECalComponentMemoPreview, e_cal_component_memo_preview, GTK_TYPE_TABLE) static void @@ -100,47 +100,12 @@ url_requested_cb (GtkHTML *html, const char *url, GtkHTMLStream *stream, gpointe } } -/* Converts a time_t to a string, relative to the specified timezone */ -static char * -timet_to_str_with_zone (ECalComponentDateTime *dt, ECal *ecal, icaltimezone *default_zone) -{ - struct icaltimetype itt; - icaltimezone *zone; - struct tm tm; - char buf[256]; - - if (dt->tzid) { - /* If we can't find the zone, we'll guess its "local" */ - if (!e_cal_get_timezone (ecal, dt->tzid, &zone, NULL)) - zone = NULL; - } else if (dt->value->is_utc) { - zone = icaltimezone_get_utc_timezone (); - } else { - zone = NULL; - } - - - itt = *dt->value; - if (zone) - icaltimezone_convert_time (&itt, zone, default_zone); - tm = icaltimetype_to_tm (&itt); - - e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (), - FALSE, FALSE, buf, sizeof (buf)); - - return g_locale_to_utf8 (buf, -1, NULL, NULL, NULL); -} - static void write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone *default_zone) { ECalComponentText text; - ECalComponentDateTime dt; gchar *str; GSList *l; - icalproperty_status status; - const char *location; - int *priority_value; gboolean one_added = FALSE; g_return_if_fail (E_IS_CAL_COMPONENT (comp)); @@ -152,7 +117,7 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone e_cal_component_get_categories_list (comp, &l); if (l) { GSList *node; - GString *str = g_string_new (""); + GString *string = g_string_new (""); gtk_html_stream_printf(stream, "<H3>Categories: "); @@ -170,16 +135,16 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone } else{ if(one_added == FALSE){ - g_string_append_printf (str, "%s", (const char *) node->data); + g_string_append_printf (string, "%s", (const char *) node->data); one_added = TRUE; } else{ - g_string_append_printf (str, ", %s", (const char *) node->data); + g_string_append_printf (string, ", %s", (const char *) node->data); } } } - gtk_html_stream_printf(stream, str->str); + gtk_html_stream_printf(stream, string->str); gtk_html_stream_printf(stream, "</H3>"); @@ -204,23 +169,23 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone for (node = l; node != NULL; node = node->next) { gint i, j; - GString *str = g_string_new (""); + GString *string = g_string_new (""); text = * (ECalComponentText *) node->data; for (i = 0, j=0; i < strlen (text.value ? text.value : 0); i++, j++) { if (text.value[i] == '\n'){ - str = g_string_append (str, "<BR>"); + string = g_string_append (string, "<BR>"); } else if (text.value[i] == '<') - str = g_string_append (str, "<"); + string = g_string_append (string, "<"); else if (text.value[i] == '>') - str = g_string_append (str, ">"); + string = g_string_append (string, ">"); else - str = g_string_append_c (str, text.value[i]); + string = g_string_append_c (string, text.value[i]); } - gtk_html_stream_printf (stream, str->str); - g_string_free (str, TRUE); + gtk_html_stream_printf (stream, string->str); + g_string_free (string, TRUE); } gtk_html_stream_printf (stream, "</TD></TR>"); diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index 055d933175..5a6a056d8c 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -44,7 +44,7 @@ struct _ECalComponentPreviewPrivate { icaltimezone *zone; }; -G_DEFINE_TYPE (ECalComponentPreview, e_cal_component_preview, GTK_TYPE_TABLE); +G_DEFINE_TYPE (ECalComponentPreview, e_cal_component_preview, GTK_TYPE_TABLE) static void on_link_clicked (GtkHTML *html, const char *url, gpointer data) @@ -272,22 +272,22 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone for (node = l; node != NULL; node = node->next) { gint i; - GString *str = g_string_new ("");; + GString *string = g_string_new ("");; text = * (ECalComponentText *) node->data; for (i = 0; i < strlen (text.value ? text.value : 0); i++) { if (text.value[i] == '\n') - str = g_string_append (str, "<BR>"); + string = g_string_append (string, "<BR>"); else if (text.value[i] == '<') - str = g_string_append (str, "<"); + string = g_string_append (string, "<"); else if (text.value[i] == '>') - str = g_string_append (str, ">"); + string = g_string_append (string, ">"); else - str = g_string_append_c (str, text.value[i]); + string = g_string_append_c (string, text.value[i]); } - gtk_html_stream_printf (stream, "%s", str->str); - g_string_free (str, TRUE); + gtk_html_stream_printf (stream, "%s", string->str); + g_string_free (string, TRUE); } gtk_html_stream_printf (stream, "</TD></TR>"); diff --git a/calendar/gui/e-cal-list-view-config.c b/calendar/gui/e-cal-list-view-config.c index 51ebd58ed4..80ac9a46be 100644 --- a/calendar/gui/e-cal-list-view-config.c +++ b/calendar/gui/e-cal-list-view-config.c @@ -36,16 +36,14 @@ enum props { PROP_VIEW, }; -G_DEFINE_TYPE (ECalListViewConfig, e_cal_list_view_config, G_TYPE_OBJECT); +G_DEFINE_TYPE (ECalListViewConfig, e_cal_list_view_config, G_TYPE_OBJECT) static void e_cal_list_view_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ECalListViewConfig *view_config; - ECalListViewConfigPrivate *priv; view_config = E_CAL_LIST_VIEW_CONFIG (object); - priv = view_config->priv; switch (property_id) { case PROP_VIEW: @@ -61,10 +59,8 @@ static void e_cal_list_view_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ECalListViewConfig *view_config; - ECalListViewConfigPrivate *priv; view_config = E_CAL_LIST_VIEW_CONFIG (object); - priv = view_config->priv; switch (property_id) { case PROP_VIEW: @@ -80,10 +76,7 @@ static void e_cal_list_view_config_dispose (GObject *object) { ECalListViewConfig *view_config = E_CAL_LIST_VIEW_CONFIG (object); - ECalListViewConfigPrivate *priv; - priv = view_config->priv; - e_cal_list_view_config_set_view (view_config, NULL); if (G_OBJECT_CLASS (e_cal_list_view_config_parent_class)->dispose) diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c index 6cd15bb645..fa41d4cae2 100644 --- a/calendar/gui/e-cal-list-view.c +++ b/calendar/gui/e-cal-list-view.c @@ -89,7 +89,7 @@ static gboolean e_cal_list_view_on_table_right_click (GtkWidget *table, gint GdkEvent *event, gpointer data); static void e_cal_list_view_cursor_change_cb (ETable *etable, gint row, gpointer data); -G_DEFINE_TYPE (ECalListView, e_cal_list_view, E_TYPE_CALENDAR_VIEW); +G_DEFINE_TYPE (ECalListView, e_cal_list_view, E_TYPE_CALENDAR_VIEW) static void e_cal_list_view_class_init (ECalListViewClass *class) diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index d79a5eecde..f27bd8b451 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -49,7 +49,7 @@ static char *ecmc_value_to_string (ETableModel *etm, int col, const void *value) static void ecmc_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, ETableModel *source_model, gint row); -G_DEFINE_TYPE (ECalModelCalendar, e_cal_model_calendar, E_TYPE_CAL_MODEL); +G_DEFINE_TYPE (ECalModelCalendar, e_cal_model_calendar, E_TYPE_CAL_MODEL) static void e_cal_model_calendar_class_init (ECalModelCalendarClass *klass) @@ -193,13 +193,10 @@ static void * ecmc_value_at (ETableModel *etm, int col, int row) { ECalModelComponent *comp_data; - ECalModelCalendarPrivate *priv; ECalModelCalendar *model = (ECalModelCalendar *) etm; g_return_val_if_fail (E_IS_CAL_MODEL_CALENDAR (model), NULL); - priv = model->priv; - g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_CALENDAR_FIELD_LAST, NULL); g_return_val_if_fail (row >= 0 && row < e_table_model_row_count (etm), NULL); diff --git a/calendar/gui/e-cal-model-memos.c b/calendar/gui/e-cal-model-memos.c index 0f8dc020a1..ea43f33f7f 100644 --- a/calendar/gui/e-cal-model-memos.c +++ b/calendar/gui/e-cal-model-memos.c @@ -51,7 +51,7 @@ static char *ecmm_value_to_string (ETableModel *etm, int col, const void *value) static void ecmm_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, ETableModel *source_model, gint row); -G_DEFINE_TYPE (ECalModelMemos, e_cal_model_memos, E_TYPE_CAL_MODEL); +G_DEFINE_TYPE (ECalModelMemos, e_cal_model_memos, E_TYPE_CAL_MODEL) static void e_cal_model_memos_class_init (ECalModelMemosClass *klass) @@ -115,13 +115,10 @@ static void * ecmm_value_at (ETableModel *etm, int col, int row) { ECalModelComponent *comp_data; - ECalModelMemosPrivate *priv; ECalModelMemos *model = (ECalModelMemos *) etm; g_return_val_if_fail (E_IS_CAL_MODEL_MEMOS (model), NULL); - priv = model->priv; - g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_MEMOS_FIELD_LAST, NULL); g_return_val_if_fail (row >= 0 && row < e_table_model_row_count (etm), NULL); diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index 5bdcd113ca..d0f343a9b2 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -52,7 +52,7 @@ static const char *ecmt_get_color_for_component (ECalModel *model, ECalModelComp static void ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, ETableModel *source_model, gint row); -G_DEFINE_TYPE (ECalModelTasks, e_cal_model_tasks, E_TYPE_CAL_MODEL); +G_DEFINE_TYPE (ECalModelTasks, e_cal_model_tasks, E_TYPE_CAL_MODEL) static void e_cal_model_tasks_class_init (ECalModelTasksClass *klass) @@ -443,8 +443,6 @@ get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data) return E_CAL_MODEL_TASKS_DUE_FUTURE; } } - - return E_CAL_MODEL_TASKS_DUE_NEVER; } static gboolean @@ -466,14 +464,11 @@ is_overdue (ECalModelTasks *model, ECalModelComponent *comp_data) static void * ecmt_value_at (ETableModel *etm, int col, int row) { - ECalModelTasksPrivate *priv; ECalModelComponent *comp_data; ECalModelTasks *model = (ECalModelTasks *) etm; g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), NULL); - priv = model->priv; - g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, NULL); g_return_val_if_fail (row >= 0 && row < e_table_model_row_count (etm), NULL); @@ -783,14 +778,11 @@ set_url (ECalModelComponent *comp_data, const char *value) static void ecmt_set_value_at (ETableModel *etm, int col, int row, const void *value) { - ECalModelTasksPrivate *priv; ECalModelComponent *comp_data; ECalModelTasks *model = (ECalModelTasks *) etm; g_return_if_fail (E_IS_CAL_MODEL_TASKS (model)); - priv = model->priv; - g_return_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST); g_return_if_fail (row >= 0 && row < e_table_model_row_count (etm)); @@ -841,13 +833,10 @@ ecmt_set_value_at (ETableModel *etm, int col, int row, const void *value) static gboolean ecmt_is_cell_editable (ETableModel *etm, int col, int row) { - ECalModelTasksPrivate *priv; ECalModelTasks *model = (ECalModelTasks *) etm; g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), FALSE); - priv = model->priv; - g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, FALSE); g_return_val_if_fail (row >= -1 || (row >= 0 && row < e_table_model_row_count (etm)), FALSE); @@ -964,14 +953,11 @@ ecmt_initialize_value (ETableModel *etm, int col) static gboolean ecmt_value_is_empty (ETableModel *etm, int col, const void *value) { - ECalModelTasksPrivate *priv; ECalModelTasks *model = (ECalModelTasks *) etm; g_return_val_if_fail (E_IS_CAL_MODEL_TASKS (model), TRUE); g_return_val_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST, TRUE); - priv = model->priv; - if (col < E_CAL_MODEL_FIELD_LAST) return E_TABLE_MODEL_CLASS (e_cal_model_tasks_parent_class)->value_is_empty (etm, col, value); @@ -1096,14 +1082,11 @@ e_cal_model_tasks_new (void) void e_cal_model_tasks_mark_task_complete (ECalModelTasks *model, gint model_row) { - ECalModelTasksPrivate *priv; ECalModelComponent *comp_data; g_return_if_fail (E_IS_CAL_MODEL_TASKS (model)); g_return_if_fail (model_row >= 0 && model_row < e_table_model_row_count (E_TABLE_MODEL (model))); - priv = model->priv; - comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), model_row); if (comp_data) { e_table_model_pre_change (E_TABLE_MODEL (model)); @@ -1121,14 +1104,12 @@ void e_cal_model_tasks_update_due_tasks (ECalModelTasks *model) { gint row, row_count; - ECalModelTasksPrivate *priv; ECalModelComponent *comp_data; ECalModelTasksDueStatus status; g_return_if_fail (E_IS_CAL_MODEL_TASKS (model)); row_count = e_table_model_row_count (E_TABLE_MODEL (model)); - priv = model->priv; for (row = 0; row < row_count; row++) { diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 757892d43f..3fcd5fbe7a 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -108,7 +108,7 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (ECalModel, e_cal_model, E_TABLE_MODEL_TYPE); +G_DEFINE_TYPE (ECalModel, e_cal_model, E_TABLE_MODEL_TYPE) static void e_cal_model_class_init (ECalModelClass *klass) @@ -326,8 +326,6 @@ get_classification (ECalModelComponent *comp_data) default: return _("Unknown"); } - - return _("Unknown"); } static const char * @@ -944,7 +942,6 @@ ecm_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data) { ESource *source; guint32 source_color; - ECalModelPrivate *priv; gint i, first_empty = 0; static AssignedColorData assigned_colors[] = { { "#BECEDD", NULL }, /* 190 206 221 Blue */ @@ -961,8 +958,6 @@ ecm_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data) g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL); - priv = model->priv; - source = e_cal_get_source (comp_data->client); if (e_source_get_color (source, &source_color)) { g_free (comp_data->color); @@ -1168,8 +1163,6 @@ e_cal_model_set_default_client (ECalModel *model, ECal *client) priv = model->priv; if (priv->default_client) { - ECalModelClient *client_data; - client_data = find_client_data (model, priv->default_client); g_assert (client_data); @@ -1415,11 +1408,7 @@ e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer user_data static void e_cal_view_objects_modified_cb (ECalView *query, GList *objects, gpointer user_data) { - ECalModelPrivate *priv; ECalModel *model = (ECalModel *) user_data; - GList *l; - - priv = model->priv; /* now re-add all objects */ e_cal_view_objects_added_cb (query, objects, model); @@ -1601,14 +1590,11 @@ add_new_client (ECalModel *model, ECal *client, gboolean do_query) void e_cal_model_add_client (ECalModel *model, ECal *client) { - ECalModelPrivate *priv; ECalModelClient *client_data; - + g_return_if_fail (E_IS_CAL_MODEL (model)); g_return_if_fail (E_IS_CAL (client)); - - priv = model->priv; - + /* Check this return value or drop the assignment? */ client_data = add_new_client (model, client, TRUE); } @@ -1667,14 +1653,11 @@ remove_client (ECalModel *model, ECalModelClient *client_data) void e_cal_model_remove_client (ECalModel *model, ECal *client) { - ECalModelPrivate *priv; ECalModelClient *client_data; g_return_if_fail (E_IS_CAL_MODEL (model)); g_return_if_fail (E_IS_CAL (client)); - priv = model->priv; - client_data = find_client_data (model, client); if (client_data) remove_client (model, client_data); @@ -2102,9 +2085,8 @@ e_cal_model_get_object_array (ECalModel *model) void e_cal_model_set_instance_times (ECalModelComponent *comp_data, icaltimezone *zone) { - struct icaltimetype recur_time, start_time, end_time; + struct icaltimetype start_time, end_time; - recur_time = icalcomponent_get_recurrenceid (comp_data->icalcomp); start_time = icalcomponent_get_dtstart (comp_data->icalcomp); end_time = icalcomponent_get_dtend (comp_data->icalcomp); diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c index 89cae6de73..c4cc57ee9c 100644 --- a/calendar/gui/e-cal-popup.c +++ b/calendar/gui/e-cal-popup.c @@ -157,7 +157,8 @@ ecalp_part_popup_saveas(EPopup *ep, EPopupItem *item, void *data) { EPopupTarget *t = ep->target; CamelMimePart *part = NULL; - char *file, *filename, *mfilename = NULL; + char *file, *mfilename = NULL; + const char *filename; part = ((EAttachment *) ((ECalPopupTargetAttachments *) t)->attachments->data)->body; filename = camel_mime_part_get_filename (part); diff --git a/calendar/gui/e-calendar-table-config.c b/calendar/gui/e-calendar-table-config.c index ebe148b4fd..07412621bd 100644 --- a/calendar/gui/e-calendar-table-config.c +++ b/calendar/gui/e-calendar-table-config.c @@ -38,16 +38,14 @@ enum props { PROP_TABLE }; -G_DEFINE_TYPE (ECalendarTableConfig, e_calendar_table_config, G_TYPE_OBJECT); +G_DEFINE_TYPE (ECalendarTableConfig, e_calendar_table_config, G_TYPE_OBJECT) static void e_calendar_table_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ECalendarTableConfig *table_config; - ECalendarTableConfigPrivate *priv; table_config = E_CALENDAR_TABLE_CONFIG (object); - priv = table_config->priv; switch (property_id) { case PROP_TABLE: @@ -63,10 +61,8 @@ static void e_calendar_table_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ECalendarTableConfig *table_config; - ECalendarTableConfigPrivate *priv; table_config = E_CALENDAR_TABLE_CONFIG (object); - priv = table_config->priv; switch (property_id) { case PROP_TABLE: @@ -82,10 +78,7 @@ static void e_calendar_table_config_dispose (GObject *object) { ECalendarTableConfig *table_config = E_CALENDAR_TABLE_CONFIG (object); - ECalendarTableConfigPrivate *priv; - priv = table_config->priv; - e_calendar_table_config_set_table (table_config, NULL); if (G_OBJECT_CLASS (e_calendar_table_config_parent_class)->dispose) diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 5ac2e52d2a..164aef0786 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -113,16 +113,14 @@ static GdkPixbuf* icon_pixbufs[E_CALENDAR_MODEL_NUM_ICONS] = { 0 }; static GdkAtom clipboard_atom = GDK_NONE; -G_DEFINE_TYPE (ECalendarTable, e_calendar_table, GTK_TYPE_TABLE); +G_DEFINE_TYPE (ECalendarTable, e_calendar_table, GTK_TYPE_TABLE) static void e_calendar_table_class_init (ECalendarTableClass *class) { GtkObjectClass *object_class; - GtkWidgetClass *widget_class; object_class = (GtkObjectClass *) class; - widget_class = (GtkWidgetClass *) class; /* Method override */ object_class->destroy = e_calendar_table_destroy; diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h index 427192259e..56de26b689 100644 --- a/calendar/gui/e-calendar-table.h +++ b/calendar/gui/e-calendar-table.h @@ -110,6 +110,8 @@ void e_calendar_table_open_task (ECalendarTable *cal_table, ECalModelComponent * e_calendar_table_get_selected_comp (ECalendarTable *cal_table); void e_calendar_table_hide_completed_tasks (ECalendarTable *table, GList *clients_list, gboolean config_changed); +void e_calendar_table_process_completed_tasks (ECalendarTable *table, GList *clients_list, gboolean config_changed); + G_END_DECLS #endif /* _E_CALENDAR_TABLE_H_ */ diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index cb162c6996..9e10669186 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -39,6 +39,7 @@ #include <gtk/gtkwindow.h> #include <libgnome/gnome-i18n.h> #include <libedataserver/e-time-utils.h> +#include <e-util/e-error.h> #include <e-util/e-dialog-utils.h> #include <e-util/e-icon-factory.h> #include "e-calendar-marshal.h" @@ -115,16 +116,14 @@ enum { static guint e_calendar_view_signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (ECalendarView, e_calendar_view, GTK_TYPE_TABLE); +G_DEFINE_TYPE (ECalendarView, e_calendar_view, GTK_TYPE_TABLE) static void e_calendar_view_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ECalendarView *cal_view; - ECalendarViewPrivate *priv; cal_view = E_CALENDAR_VIEW (object); - priv = cal_view->priv; switch (property_id) { case PROP_MODEL: @@ -140,10 +139,8 @@ static void e_calendar_view_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ECalendarView *cal_view; - ECalendarViewPrivate *priv; cal_view = E_CALENDAR_VIEW (object); - priv = cal_view->priv; switch (property_id) { case PROP_MODEL: @@ -275,7 +272,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart { ECalComponent *comp; struct icaltimetype itime, old_dtstart, old_dtend; - time_t tt_start, tt_end, new_dtstart; + time_t tt_start, tt_end, new_dtstart = 0; struct icaldurationtype ic_dur, ic_oneday; char *uid; gint start_offset, end_offset; @@ -1375,7 +1372,7 @@ on_delegate (EPopup *ep, EPopupItem *pitem, void *data) { ECalendarView *cal_view = data; GList *selected; - guint32 flags; + guint32 flags = 0; icalcomponent *clone; selected = e_calendar_view_get_selected_events (cal_view); @@ -1856,14 +1853,11 @@ object_created_cb (CompEditor *ce, ECalendarView *cal_view) static void open_event_with_flags (ECalendarView *cal_view, ECal *client, icalcomponent *icalcomp, guint32 flags) { - ECalendarViewPrivate *priv; CompEditor *ce; const char *uid; ECalComponent *comp; - priv = cal_view->priv; - uid = icalcomponent_get_uid (icalcomp); ce = e_comp_editor_registry_find (comp_editor_registry, uid); @@ -1944,14 +1938,14 @@ e_calendar_view_modify_and_send (ECalComponent *comp, static gboolean tooltip_grab (GtkWidget *tooltip, GdkEventKey *event, ECalendarView *view) { - GtkWidget *widget = (GtkWidget *) g_object_get_data (view, "tooltip-window"); + GtkWidget *widget = (GtkWidget *) g_object_get_data (G_OBJECT (view), "tooltip-window"); if (!widget) - return; + return TRUE; gdk_keyboard_ungrab(GDK_CURRENT_TIME); gtk_widget_destroy (widget); - g_object_set_data (view, "tooltip-window", NULL); + g_object_set_data (G_OBJECT (view), "tooltip-window", NULL); return FALSE; } @@ -1992,7 +1986,7 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) time_t t_start, t_end; ECalendarViewEvent *pevent; GtkStyle *style = gtk_widget_get_default_style (); - GtkWidget *widget = (GtkWidget *) g_object_get_data (data->cal_view, "tooltip-window"); + GtkWidget *widget = (GtkWidget *) g_object_get_data (G_OBJECT (data->cal_view), "tooltip-window"); ECalComponent *newcomp = e_cal_component_new (); icaltimezone *zone; @@ -2036,7 +2030,6 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) e_cal_component_get_organizer (newcomp, &organiser); if (organiser.cn) { char *ptr ; - GtkWidget *hbox = gtk_hbox_new (FALSE, 0); ptr = strchr(organiser.value, ':'); if (ptr) { @@ -2116,7 +2109,7 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) g_signal_connect (pevent->tooltip, "key-press-event", G_CALLBACK (tooltip_grab), data->cal_view); pevent->timeout = -1; - g_object_set_data (data->cal_view, "tooltip-window", pevent->tooltip); + g_object_set_data (G_OBJECT (data->cal_view), "tooltip-window", pevent->tooltip); g_object_unref (newcomp); g_free (data); diff --git a/calendar/gui/e-cell-date-edit-config.c b/calendar/gui/e-cell-date-edit-config.c index 0af909eb76..16923da915 100644 --- a/calendar/gui/e-cell-date-edit-config.c +++ b/calendar/gui/e-cell-date-edit-config.c @@ -38,16 +38,14 @@ enum props { PROP_CELL, }; -G_DEFINE_TYPE (ECellDateEditConfig, e_cell_date_edit_config, G_TYPE_OBJECT); +G_DEFINE_TYPE (ECellDateEditConfig, e_cell_date_edit_config, G_TYPE_OBJECT) static void e_cell_date_edit_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ECellDateEditConfig *view_config; - ECellDateEditConfigPrivate *priv; view_config = E_CELL_DATE_EDIT_CONFIG (object); - priv = view_config->priv; switch (property_id) { case PROP_CELL: @@ -63,10 +61,8 @@ static void e_cell_date_edit_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ECellDateEditConfig *view_config; - ECellDateEditConfigPrivate *priv; view_config = E_CELL_DATE_EDIT_CONFIG (object); - priv = view_config->priv; switch (property_id) { case PROP_CELL: @@ -82,10 +78,7 @@ static void e_cell_date_edit_config_dispose (GObject *object) { ECellDateEditConfig *view_config = E_CELL_DATE_EDIT_CONFIG (object); - ECellDateEditConfigPrivate *priv; - priv = view_config->priv; - e_cell_date_edit_config_set_cell (view_config, NULL); if (G_OBJECT_CLASS (e_cell_date_edit_config_parent_class)->dispose) diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c index aa05b5eef3..4dc56fa7e8 100644 --- a/calendar/gui/e-cell-date-edit-text.c +++ b/calendar/gui/e-cell-date-edit-text.c @@ -44,7 +44,7 @@ #include "e-cell-date-edit-text.h" -G_DEFINE_TYPE (ECellDateEditText, e_cell_date_edit_text, E_CELL_TEXT_TYPE); +G_DEFINE_TYPE (ECellDateEditText, e_cell_date_edit_text, E_CELL_TEXT_TYPE) void e_cell_date_edit_text_set_timezone (ECellDateEditText *ecd, diff --git a/calendar/gui/e-comp-editor-registry.c b/calendar/gui/e-comp-editor-registry.c index 1f679097bd..88fea4f8a8 100644 --- a/calendar/gui/e-comp-editor-registry.c +++ b/calendar/gui/e-comp-editor-registry.c @@ -43,7 +43,7 @@ typedef struct _ECompEditorRegistryForeachData ECompEditorRegistryForeachData; static void editor_destroy_cb (gpointer data, GObject *where_object_was); -G_DEFINE_TYPE (ECompEditorRegistry, e_comp_editor_registry, G_TYPE_OBJECT); +G_DEFINE_TYPE (ECompEditorRegistry, e_comp_editor_registry, G_TYPE_OBJECT) static void registry_data_free (gpointer data) diff --git a/calendar/gui/e-date-edit-config.c b/calendar/gui/e-date-edit-config.c index acc61bda61..f811d96a90 100644 --- a/calendar/gui/e-date-edit-config.c +++ b/calendar/gui/e-date-edit-config.c @@ -35,16 +35,14 @@ enum props { PROP_EDIT, }; -G_DEFINE_TYPE (EDateEditConfig, e_date_edit_config, G_TYPE_OBJECT); +G_DEFINE_TYPE (EDateEditConfig, e_date_edit_config, G_TYPE_OBJECT) static void e_date_edit_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { EDateEditConfig *edit_config; - EDateEditConfigPrivate *priv; edit_config = E_DATE_EDIT_CONFIG (object); - priv = edit_config->priv; switch (property_id) { case PROP_EDIT: @@ -60,10 +58,8 @@ static void e_date_edit_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { EDateEditConfig *edit_config; - EDateEditConfigPrivate *priv; edit_config = E_DATE_EDIT_CONFIG (object); - priv = edit_config->priv; switch (property_id) { case PROP_EDIT: @@ -79,10 +75,7 @@ static void e_date_edit_config_dispose (GObject *object) { EDateEditConfig *edit_config = E_DATE_EDIT_CONFIG (object); - EDateEditConfigPrivate *priv; - priv = edit_config->priv; - e_date_edit_config_set_edit (edit_config, NULL); if (G_OBJECT_CLASS (e_date_edit_config_parent_class)->dispose) diff --git a/calendar/gui/e-day-view-config.c b/calendar/gui/e-day-view-config.c index b65d236bd1..c5fe53e293 100644 --- a/calendar/gui/e-day-view-config.c +++ b/calendar/gui/e-day-view-config.c @@ -36,16 +36,14 @@ enum props { PROP_VIEW, }; -G_DEFINE_TYPE (EDayViewConfig, e_day_view_config, G_TYPE_OBJECT); +G_DEFINE_TYPE (EDayViewConfig, e_day_view_config, G_TYPE_OBJECT) static void e_day_view_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { EDayViewConfig *view_config; - EDayViewConfigPrivate *priv; view_config = E_DAY_VIEW_CONFIG (object); - priv = view_config->priv; switch (property_id) { case PROP_VIEW: @@ -61,10 +59,8 @@ static void e_day_view_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { EDayViewConfig *view_config; - EDayViewConfigPrivate *priv; view_config = E_DAY_VIEW_CONFIG (object); - priv = view_config->priv; switch (property_id) { case PROP_VIEW: @@ -80,9 +76,6 @@ static void e_day_view_config_dispose (GObject *object) { EDayViewConfig *view_config = E_DAY_VIEW_CONFIG (object); - EDayViewConfigPrivate *priv; - - priv = view_config->priv; e_day_view_config_set_view (view_config, NULL); diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 6203e264e8..0522db2ce7 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -81,7 +81,7 @@ enum { ARG_DAY_VIEW }; -G_DEFINE_TYPE (EDayViewMainItem, e_day_view_main_item, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EDayViewMainItem, e_day_view_main_item, GNOME_TYPE_CANVAS_ITEM) static void e_day_view_main_item_class_init (EDayViewMainItemClass *class) @@ -119,10 +119,8 @@ e_day_view_main_item_init (EDayViewMainItem *dvtitem) static void e_day_view_main_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) { - GnomeCanvasItem *item; EDayViewMainItem *dvmitem; - item = GNOME_CANVAS_ITEM (o); dvmitem = E_DAY_VIEW_MAIN_ITEM (o); switch (arg_id){ @@ -500,7 +498,6 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, EDayView *day_view; EDayViewEvent *event; gint item_x, item_y, item_w, item_h, bar_y1, bar_y2; - GtkStyle *style; GdkGC *gc; GdkColor bg_color; ECalComponent *comp; @@ -519,8 +516,6 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, && day_view->drag_event_num == event_num) return; - style = GTK_WIDGET (day_view)->style; - gc = day_view->main_gc; /* Get the position of the event. If it is not shown skip it.*/ @@ -841,10 +836,6 @@ e_day_view_main_item_point (GnomeCanvasItem *item, double x, double y, static gint e_day_view_main_item_event (GnomeCanvasItem *item, GdkEvent *event) { - EDayViewMainItem *dvtitem; - - dvtitem = E_DAY_VIEW_MAIN_ITEM (item); - switch (event->type) { case GDK_BUTTON_PRESS: diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index c4705e69f0..4c2ed4d63c 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -103,7 +103,7 @@ enum { ARG_DAY_VIEW }; -G_DEFINE_TYPE (EDayViewTimeItem, e_day_view_time_item, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EDayViewTimeItem, e_day_view_time_item, GNOME_TYPE_CANVAS_ITEM) static void e_day_view_time_item_class_init (EDayViewTimeItemClass *class) @@ -138,10 +138,8 @@ e_day_view_time_item_init (EDayViewTimeItem *dvtmitem) static void e_day_view_time_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) { - GnomeCanvasItem *item; EDayViewTimeItem *dvtmitem; - item = GNOME_CANVAS_ITEM (o); dvtmitem = E_DAY_VIEW_TIME_ITEM (o); switch (arg_id){ @@ -180,7 +178,6 @@ e_day_view_time_item_get_column_width (EDayViewTimeItem *dvtmitem) gint digit, large_digit_width, max_large_digit_width = 0; gint max_suffix_width, max_minute_or_suffix_width; gint column_width_default, column_width_60_min_rows; - PangoContext *context; day_view = dvtmitem->day_view; g_return_val_if_fail (day_view != NULL, 0); @@ -188,8 +185,6 @@ e_day_view_time_item_get_column_width (EDayViewTimeItem *dvtmitem) style = gtk_widget_get_style (GTK_WIDGET (day_view)); g_return_val_if_fail (style != NULL, 0); - context = gtk_widget_get_pango_context (GTK_WIDGET (day_view)); - /* Find the maximum width a digit can have. FIXME: We could use pango's * approximation function, but I worry it won't be precise enough. Also * it needs a language tag that I don't know where to get. */ diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index c0f8c6b0d5..bfdc31bbd9 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -33,6 +33,7 @@ #include <libgnome/gnome-i18n.h> #include "e-util/e-categories-config.h" #include <libecal/e-cal-time-util.h> +#include <libedataserver/e-data-server-util.h> #include "e-day-view-top-item.h" static void e_day_view_top_item_set_arg (GtkObject *o, @@ -78,7 +79,7 @@ enum { ARG_DAY_VIEW }; -G_DEFINE_TYPE (EDayViewTopItem, e_day_view_top_item, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EDayViewTopItem, e_day_view_top_item, GNOME_TYPE_CANVAS_ITEM) static void e_day_view_top_item_class_init (EDayViewTopItemClass *class) @@ -113,10 +114,8 @@ e_day_view_top_item_init (EDayViewTopItem *dvtitem) static void e_day_view_top_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) { - GnomeCanvasItem *item; EDayViewTopItem *dvtitem; - item = GNOME_CANVAS_ITEM (o); dvtitem = E_DAY_VIEW_TOP_ITEM (o); switch (arg_id){ @@ -307,7 +306,7 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, EDayView *day_view; EDayViewEvent *event; GtkStyle *style; - GdkGC *gc, *fg_gc, *bg_gc; + GdkGC *gc, *fg_gc; gint start_day, end_day; gint item_x, item_y, item_w, item_h; gint text_x, icon_x, icon_y, icon_x_inc; @@ -342,7 +341,6 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, style = gtk_widget_get_style (GTK_WIDGET (day_view)); gc = day_view->main_gc; fg_gc = style->fg_gc[GTK_STATE_NORMAL]; - bg_gc = style->bg_gc[GTK_STATE_NORMAL]; comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); @@ -606,7 +604,6 @@ e_day_view_top_item_draw_triangle (EDayViewTopItem *dvtitem, { EDayView *day_view; EDayViewEvent *event; - GtkStyle *style; GdkGC *gc; GdkColor bg_color; GdkPoint points[3]; @@ -614,7 +611,6 @@ e_day_view_top_item_draw_triangle (EDayViewTopItem *dvtitem, day_view = dvtitem->day_view; - style = GTK_WIDGET (day_view)->style; gc = day_view->main_gc; points[0].x = x; @@ -671,10 +667,6 @@ e_day_view_top_item_point (GnomeCanvasItem *item, double x, double y, static gint e_day_view_top_item_event (GnomeCanvasItem *item, GdkEvent *event) { - EDayViewTopItem *dvtitem; - - dvtitem = E_DAY_VIEW_TOP_ITEM (item); - switch (event->type) { case GDK_BUTTON_PRESS: diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index d7caff97ce..a827de2a47 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -54,6 +54,7 @@ #include <e-util/e-dialog-utils.h> #include <libecal/e-cal-time-util.h> +#include <libedataserver/e-data-server-util.h> #include "dialogs/delete-comp.h" #include "dialogs/delete-error.h" #include "dialogs/send-comp.h" @@ -359,8 +360,6 @@ static void e_day_view_start_auto_scroll (EDayView *day_view, gboolean scroll_up); static gboolean e_day_view_auto_scroll_handler (gpointer data); -static EDayViewEvent* e_day_view_get_popup_menu_event (EDayView *day_view); - static gboolean e_day_view_on_top_canvas_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, @@ -417,10 +416,6 @@ static void e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget guint time, EDayView *day_view); -static gboolean e_day_view_update_event_cb (EDayView *day_view, - gint day, - gint event_num, - gpointer data); static gboolean e_day_view_remove_event_cb (EDayView *day_view, gint day, gint event_num, @@ -439,7 +434,7 @@ static void e_day_view_queue_layout (EDayView *day_view); static void e_day_view_cancel_layout (EDayView *day_view); static gboolean e_day_view_layout_timeout_cb (gpointer data); -G_DEFINE_TYPE (EDayView, e_day_view, E_TYPE_CALENDAR_VIEW); +G_DEFINE_TYPE (EDayView, e_day_view, E_TYPE_CALENDAR_VIEW) static void e_day_view_class_init (EDayViewClass *class) @@ -526,6 +521,7 @@ process_component (EDayView *day_view, ECalModelComponent *comp_data) rid = e_cal_component_get_recurid_as_string (comp); else rid = NULL; + /* rid is never used below here, why? */ /* Add the object */ add_event_data.day_view = day_view; @@ -1198,7 +1194,7 @@ e_day_view_style_set (GtkWidget *widget, { EDayView *day_view; gint top_rows, top_canvas_height; - gint hour, max_large_hour_width; + gint hour; gint minute, max_minute_width, i; gint month, day, width; gint longest_month_width, longest_abbreviated_month_width; @@ -1344,7 +1340,6 @@ e_day_view_style_set (GtkWidget *widget, /* Calculate the widths of all the time strings necessary. */ day_view->max_small_hour_width = 0; - max_large_hour_width = 0; for (hour = 0; hour < 24; hour++) { g_snprintf (buffer, sizeof (buffer), "%02i", hour); pango_layout_set_text (layout, buffer, -1); @@ -1445,7 +1440,6 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) gint day, max_width; struct tm date_tm; char buffer[128]; - PangoFontDescription *font_desc; PangoContext *pango_context; PangoLayout *layout; gint pango_width; @@ -1453,7 +1447,6 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) g_return_if_fail (((GtkWidget*)day_view)->style != NULL); /* Set up Pango prerequisites */ - font_desc = gtk_widget_get_style (GTK_WIDGET (day_view))->font_desc; pango_context = gtk_widget_get_pango_context (GTK_WIDGET (day_view)); layout = pango_layout_new (pango_context); @@ -1575,46 +1568,6 @@ e_day_view_focus_out (GtkWidget *widget, GdkEventFocus *event) return FALSE; } -static gboolean -e_day_view_update_event_cb (EDayView *day_view, - gint day, - gint event_num, - gpointer data) -{ - EDayViewEvent *event; - ECalModelComponent *comp_data; - - comp_data = data; -#if 0 - g_print ("In e_day_view_update_event_cb day:%i event_num:%i\n", - day, event_num); -#endif - if (day == E_DAY_VIEW_LONG_EVENT) { - event = &g_array_index (day_view->long_events, EDayViewEvent, - event_num); - } else { - event = &g_array_index (day_view->events[day], EDayViewEvent, - event_num); - } - - e_cal_model_free_component_data (event->comp_data); - event->comp_data = e_cal_model_copy_component_data (comp_data); - - if (day == E_DAY_VIEW_LONG_EVENT) { - e_day_view_update_long_event_label (day_view, event_num); - e_day_view_reshape_long_event (day_view, event_num); - } else { - e_day_view_update_event_label (day_view, day, event_num); - e_day_view_reshape_day_event (day_view, day, event_num); - } - - g_signal_emit_by_name (G_OBJECT(day_view), - "event_changed", event); - - return TRUE; -} - - /* This calls a given function for each event instance (in both views). If the callback returns FALSE the iteration is stopped. Note that it is safe for the callback to remove the event (since we @@ -1624,6 +1577,7 @@ e_day_view_foreach_event (EDayView *day_view, EDayViewForeachEventCallback callback, gpointer data) { + /* event is never used after being set in the for loop below, why? */ EDayViewEvent *event; gint day, event_num; @@ -1747,6 +1701,7 @@ e_day_view_remove_event_cb (EDayView *day_view, return TRUE; } +#if 0 /* Checks if the users participation status is Needs action and shows the summary as bold text*/ static void set_text_as_bold (EDayViewEvent *event) @@ -1780,6 +1735,7 @@ set_text_as_bold (EDayViewEvent *event) g_object_unref (comp); g_free (address); } +#endif /* This updates the text shown for an event. If the event start or end do not lie on a row boundary, the time is displayed before the summary. */ @@ -2969,7 +2925,7 @@ e_day_view_on_time_canvas_scroll (GtkWidget *widget, if (tool_window) { gtk_widget_destroy (tool_window); - g_object_set_data (day_view, "tooltip-window", NULL); + g_object_set_data (G_OBJECT (day_view), "tooltip-window", NULL); } switch (scroll->direction) { @@ -3223,11 +3179,10 @@ e_day_view_on_event_click (EDayView *day_view, static void e_day_view_reshape_resize_long_event_rect_item (EDayView *day_view) { - gint day, event_num, start_day, end_day; + gint event_num, start_day, end_day; gint item_x, item_y, item_w, item_h; gdouble x1, y1, x2, y2; - day = day_view->resize_event_day; event_num = day_view->resize_event_num; /* If we're not resizing an event, or the event is not shown, @@ -3425,23 +3380,6 @@ e_day_view_on_event_right_click (EDayView *day_view, day, event_num); } -static EDayViewEvent* -e_day_view_get_popup_menu_event (EDayView *day_view) -{ - if (day_view->popup_event_num == -1) - return NULL; - - if (day_view->popup_event_day == E_DAY_VIEW_LONG_EVENT) - return &g_array_index (day_view->long_events, - EDayViewEvent, - day_view->popup_event_num); - else - return &g_array_index (day_view->events[day_view->popup_event_day], - EDayViewEvent, - day_view->popup_event_num); -} - - static gboolean e_day_view_on_top_canvas_button_release (GtkWidget *widget, GdkEventButton *event, @@ -3832,6 +3770,7 @@ static void e_day_view_update_long_event_resize (EDayView *day_view, gint day) { + /* event is never used here either, what's up? */ EDayViewEvent *event; gint event_num; gboolean need_reshape = FALSE; @@ -3872,6 +3811,7 @@ static void e_day_view_update_resize (EDayView *day_view, gint row) { + /* Same thing again? */ EDayViewEvent *event; gint day, event_num; gboolean need_reshape = FALSE; @@ -4390,7 +4330,6 @@ e_day_view_reshape_long_event (EDayView *day_view, gint min_text_x, max_text_w, text_width, line_len; gchar *text, *end_of_line; gboolean show_icons = TRUE, use_max_width = FALSE; - PangoFontDescription *font_desc; PangoContext *pango_context; PangoLayout *layout; @@ -4421,7 +4360,6 @@ e_day_view_reshape_long_event (EDayView *day_view, e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); /* Set up Pango prerequisites */ - font_desc = gtk_widget_get_style (GTK_WIDGET (day_view))->font_desc; pango_context = gtk_widget_get_pango_context (GTK_WIDGET (day_view)); layout = pango_layout_new (pango_context); @@ -4478,8 +4416,8 @@ e_day_view_reshape_long_event (EDayView *day_view, "fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL], "im_context", E_CANVAS (day_view->top_canvas)->im_context, NULL); - g_object_set_data (event->canvas_item, "event-num", GINT_TO_POINTER (event_num)); - g_object_set_data (event->canvas_item, "event-day", GINT_TO_POINTER (E_DAY_VIEW_LONG_EVENT)); + g_object_set_data (G_OBJECT (event->canvas_item), "event-num", GINT_TO_POINTER (event_num)); + g_object_set_data (G_OBJECT (event->canvas_item), "event-day", GINT_TO_POINTER (E_DAY_VIEW_LONG_EVENT)); g_signal_connect (event->canvas_item, "event", G_CALLBACK (e_day_view_on_text_item_event), day_view); g_signal_emit_by_name (G_OBJECT(day_view), @@ -4661,8 +4599,8 @@ e_day_view_reshape_day_event (EDayView *day_view, "fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL], "im_context", E_CANVAS (day_view->main_canvas)->im_context, NULL); - g_object_set_data (event->canvas_item, "event-num", GINT_TO_POINTER (event_num)); - g_object_set_data (event->canvas_item, "event-day", GINT_TO_POINTER (day)); + g_object_set_data (G_OBJECT (event->canvas_item), "event-num", GINT_TO_POINTER (event_num)); + g_object_set_data (G_OBJECT (event->canvas_item), "event-day", GINT_TO_POINTER (day)); g_signal_connect (event->canvas_item, "event", G_CALLBACK (e_day_view_on_text_item_event), day_view); g_signal_emit_by_name (G_OBJECT(day_view), @@ -5076,6 +5014,7 @@ e_day_view_change_duration_to_start_of_work_day (EDayView *day_view) if (day_view->selection_in_top_canvas) return; else { + /* These are never used after being set? */ gint work_start_row,work_end_row,selection_start_row,selection_end_row; work_start_row = @@ -5809,7 +5748,7 @@ tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item) pevent = tooltip_get_view_event (day_view, day, event_num); if (pevent) { - if (pevent->tooltip && g_object_get_data (day_view, "tooltip-window")) { + if (pevent->tooltip && g_object_get_data (G_OBJECT (day_view), "tooltip-window")) { gtk_widget_destroy (pevent->tooltip); pevent->tooltip = NULL; } @@ -5819,7 +5758,7 @@ tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item) pevent->timeout = -1; } - g_object_set_data (day_view, "tooltip-window", NULL); + g_object_set_data (G_OBJECT (day_view), "tooltip-window", NULL); } } @@ -5924,8 +5863,8 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, return FALSE; pevent = tooltip_get_view_event (day_view, day, event_num); - g_object_set_data (item, "event-num", GINT_TO_POINTER (event_num)); - g_object_set_data (item, "event-day", GINT_TO_POINTER (day)); + g_object_set_data (G_OBJECT (item), "event-num", GINT_TO_POINTER (event_num)); + g_object_set_data (G_OBJECT (item), "event-day", GINT_TO_POINTER (day)); data = g_malloc (sizeof (ECalendarViewEventData)); pevent->x = ((GdkEventCrossing *)event)->x_root; @@ -5953,7 +5892,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, pevent->x = ((GdkEventMotion *)event)->x_root; pevent->y = ((GdkEventMotion *)event)->y_root; - pevent->tooltip = (GtkWidget *)g_object_get_data (day_view, "tooltip-window"); + pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (day_view), "tooltip-window"); if (pevent->tooltip) { gtk_window_move ((GtkWindow *)pevent->tooltip, ((int)((GdkEventMotion *)event)->x_root)+16, ((int)((GdkEventMotion *)event)->y_root) +16); @@ -6229,7 +6168,6 @@ e_day_view_on_editing_stopped (EDayView *day_view, GnomeCanvasItem *item) { gint day, event_num; - gboolean editing_long_event = FALSE; EDayViewEvent *event; gchar *text = NULL; ECalComponentText summary; @@ -6253,7 +6191,6 @@ e_day_view_on_editing_stopped (EDayView *day_view, return; if (day == E_DAY_VIEW_LONG_EVENT) { - editing_long_event = TRUE; event = &g_array_index (day_view->long_events, EDayViewEvent, event_num); } else { diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index d34b9d9fb7..314387e1eb 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -113,15 +113,13 @@ static void url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *ha static gboolean object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data); static void ok_clicked_cb (GtkWidget *widget, gpointer data); -G_DEFINE_TYPE (EItipControl, e_itip_control, GTK_TYPE_VBOX); +G_DEFINE_TYPE (EItipControl, e_itip_control, GTK_TYPE_VBOX) static void e_itip_control_class_init (EItipControlClass *klass) { - GObjectClass *object_class; GtkObjectClass *gtkobject_class; - object_class = G_OBJECT_CLASS (klass); gtkobject_class = GTK_OBJECT_CLASS (klass); gtkobject_class->destroy = e_itip_control_destroy; @@ -276,7 +274,6 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) if (fd->count == 0) { if (fd->show_selector && !priv->current_ecal && priv->vbox) { GtkWidget *esom; - ESource *source = NULL; char *uid; switch (priv->type) { @@ -353,7 +350,7 @@ find_server (EItipControl *itip, ECalComponent *comp, gboolean show_selector) fd->show_selector = show_selector; } fd->count++; - + /* Check this return too? */ ecal = start_calendar_server (itip, source, priv->type, find_cal_opened_cb, fd); } } @@ -846,15 +843,12 @@ static void set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream, ECalComponent *comp) { - EItipControlPrivate *priv; ECalComponentDateTime datetime; static char buffer[1024]; gchar *str; gboolean wrote = FALSE, task_completed = FALSE; ECalComponentVType type; - priv = itip->priv; - type = e_cal_component_get_vtype (comp); buffer[0] = '\0'; @@ -1988,35 +1982,6 @@ update_attendee_status (EItipControl *itip) } static void -remove_item (EItipControl *itip) -{ - EItipControlPrivate *priv; - const char *uid; - GtkWidget *dialog; - GError *error = NULL; - - priv = itip->priv; - - /* FIXME Is this check necessary? */ - if (!priv->current_ecal) - return; - - e_cal_component_get_uid (priv->comp, &uid); - if (e_cal_component_has_recurrences (priv->comp)) - e_cal_remove_object_with_mod (priv->current_ecal, uid, NULL, CALOBJ_MOD_ALL, &error); - else - e_cal_remove_object (priv->current_ecal, uid, &error); - if (!error || error->code == E_CALENDAR_STATUS_OBJECT_NOT_FOUND) { - dialog = gnome_ok_dialog (_("Removal Complete")); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); - } else { - delete_error_dialog (error, e_cal_component_get_vtype (priv->comp)); - } - - g_clear_error (&error); -} - -static void send_item (EItipControl *itip) { EItipControlPrivate *priv; @@ -2470,7 +2435,6 @@ ok_clicked_cb (GtkWidget *widget, gpointer data) if (priv->rsvp && status) { ECalComponent *comp = NULL; - ECalComponentVType vtype; icalcomponent *ical_comp; icalproperty *prop; icalvalue *value; @@ -2480,7 +2444,6 @@ ok_clicked_cb (GtkWidget *widget, gpointer data) comp = e_cal_component_clone (priv->comp); if (comp == NULL) return; - vtype = e_cal_component_get_vtype (comp); if (priv->my_address == NULL) find_my_address (itip, priv->ical_comp, NULL); diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c index e66667fd0b..926cbd4925 100644 --- a/calendar/gui/e-meeting-attendee.c +++ b/calendar/gui/e-meeting-attendee.c @@ -69,7 +69,7 @@ static guint signals[LAST_SIGNAL]; static void e_meeting_attendee_finalize (GObject *obj); -G_DEFINE_TYPE (EMeetingAttendee, e_meeting_attendee, G_TYPE_OBJECT); +G_DEFINE_TYPE (EMeetingAttendee, e_meeting_attendee, G_TYPE_OBJECT) static void e_meeting_attendee_class_init (EMeetingAttendeeClass *klass) diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 96982269e3..839ba1b3db 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -42,6 +42,7 @@ #include <libedataserverui/e-name-selector.h> #include "calendar-config.h" #include "e-meeting-list-view.h" +#include "itip-utils.h" #include <misc/e-cell-renderer-combo.h> #include <libebook/e-destination.h> #include "e-select-names-renderer.h" @@ -77,7 +78,7 @@ static icalparameter_role roles[] = {ICAL_ROLE_CHAIR, ICAL_ROLE_NONPARTICIPANT, ICAL_ROLE_NONE}; -G_DEFINE_TYPE (EMeetingListView, e_meeting_list_view, GTK_TYPE_TREE_VIEW); +G_DEFINE_TYPE (EMeetingListView, e_meeting_list_view, GTK_TYPE_TREE_VIEW) static void e_meeting_list_view_finalize (GObject *obj) @@ -285,7 +286,7 @@ e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, if (e_destination_is_evolution_list (des)) { GList *l, *dl; - + dl = e_destination_list_get_dests (des); for (l = dl; l; l = l->next) { @@ -668,7 +669,7 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role priv = view->priv; for (l = destinations; l; l = g_list_next (l)) { EDestination *destination = l->data, *des = NULL; - const GList *list_dests, *l; + const GList *list_dests = NULL, *l; GList card_dest; if (e_destination_is_evolution_list (destination)) { @@ -777,7 +778,7 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role g_slist_free (*la); *la = NULL; } else - *la = g_slist_remove_link (*la, g_slist_find_custom (*la, attendee, g_strcasecmp)); + *la = g_slist_remove_link (*la, g_slist_find_custom (*la, attendee, (GCompareFunc)g_strcasecmp)); } } @@ -808,7 +809,7 @@ name_selector_dialog_close_cb (ENameSelectorDialog *dialog, gint response, gpoin GSList *la = NULL, *l; name_selector_model = e_name_selector_peek_model (view->priv->name_selector); - store = E_MEETING_STORE (gtk_tree_view_get_model (view)); + store = E_MEETING_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view))); attendees = e_meeting_store_get_attendees (store); /* get all the email ids of the attendees */ @@ -855,7 +856,6 @@ e_meeting_list_view_invite_others_dialog (EMeetingListView *view) void e_meeting_list_view_set_editable (EMeetingListView *lview, gboolean set) { - GtkCellRenderer *renderer; EMeetingListViewPrivate *priv; priv = lview->priv; @@ -865,10 +865,3 @@ e_meeting_list_view_set_editable (EMeetingListView *lview, gboolean set) g_hash_table_foreach (priv->renderers, change_edit_cols_for_organizer, GINT_TO_POINTER (edit_level)); } -static void -set_editable (gpointer key, gpointer value, gpointer user_data) -{ - GtkCellRenderer *renderer = (GtkCellRenderer *) value; - guint edit_level = GPOINTER_TO_INT (user_data); - g_object_set (G_OBJECT (renderer), "editable", GINT_TO_POINTER (edit_level), NULL); -} diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index 9a86a16b28..a942d83779 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -159,8 +159,6 @@ role_to_text (icalparameter_role role) default: return _("Unknown"); } - - return NULL; } static gboolean @@ -224,8 +222,6 @@ partstat_to_text (icalparameter_partstat partstat) default: return _("Unknown"); } - - return NULL; } static GtkTreeModelFlags @@ -518,41 +514,6 @@ e_meeting_store_set_value (EMeetingStore *store, int row, int col, const gchar * } } -static gboolean -is_cell_editable (EMeetingStore *etm, int col, int row) -{ - EMeetingStore *store; - EMeetingStorePrivate *priv; - EMeetingAttendee *attendee; - EMeetingAttendeeEditLevel level; - - store = E_MEETING_STORE (etm); - priv = store->priv; - - if (col == E_MEETING_STORE_DELTO_COL - || col == E_MEETING_STORE_DELFROM_COL) - return FALSE; - - if (row == -1) - return TRUE; - if (row >= priv->attendees->len) - return TRUE; - - attendee = g_ptr_array_index (priv->attendees, row); - level = e_meeting_attendee_get_edit_level (attendee); - - switch (level) { - case E_MEETING_ATTENDEE_EDIT_FULL: - return TRUE; - case E_MEETING_ATTENDEE_EDIT_STATUS: - return col == E_MEETING_STORE_STATUS_COL; - case E_MEETING_ATTENDEE_EDIT_NONE: - return FALSE; - } - - return TRUE; -} - static void refresh_queue_remove (EMeetingStore *store, EMeetingAttendee *attendee) { diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c index 74d2931b5e..39e0b1ae80 100644 --- a/calendar/gui/e-meeting-time-sel-item.c +++ b/calendar/gui/e-meeting-time-sel-item.c @@ -100,7 +100,7 @@ enum { ARG_MEETING_TIME_SELECTOR }; -G_DEFINE_TYPE (EMeetingTimeSelectorItem, e_meeting_time_selector_item, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EMeetingTimeSelectorItem, e_meeting_time_selector_item, GNOME_TYPE_CANVAS_ITEM) static void e_meeting_time_selector_item_class_init (EMeetingTimeSelectorItemClass *mts_item_class) @@ -174,10 +174,8 @@ e_meeting_time_selector_item_destroy (GtkObject *object) static void e_meeting_time_selector_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) { - GnomeCanvasItem *item; EMeetingTimeSelectorItem *mts_item; - item = GNOME_CANVAS_ITEM (o); mts_item = E_MEETING_TIME_SELECTOR_ITEM (o); switch (arg_id){ @@ -510,6 +508,7 @@ e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelec /* Get the first visible busy periods for all the attendees. */ first_periods = g_new (gint, e_meeting_store_count_actual_attendees (mts->model)); for (row = 0; row < e_meeting_store_count_actual_attendees (mts->model); row++) { + /* This is never used */ ia = e_meeting_store_find_attendee_at_row (mts->model, row); first_periods[row] = e_meeting_time_selector_item_find_first_busy_period (mts_item, date, row); } diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index 92efe897d6..f25ceb4d80 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -210,7 +210,7 @@ static void row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, gpointer dat static void free_busy_template_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data); -G_DEFINE_TYPE (EMeetingTimeSelector, e_meeting_time_selector, GTK_TYPE_TABLE); +G_DEFINE_TYPE (EMeetingTimeSelector, e_meeting_time_selector, GTK_TYPE_TABLE) static void e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * klass) @@ -267,11 +267,9 @@ e_meeting_time_selector_init (EMeetingTimeSelector * mts) void e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *ems) { - char *filename; GtkWidget *hbox, *vbox, *separator, *label, *table, *sw; GtkWidget *alignment, *child_hbox, *arrow, *menuitem; GSList *group; - GdkVisual *visual; GdkColormap *colormap; guint accel_key; time_t meeting_start_time; @@ -319,8 +317,6 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em /* build the etable */ - filename = g_build_filename (calendar_component_peek_config_directory (calendar_component_peek ()), - "config", "et-header-meeting-time-sel", NULL); mts->model = ems; if (mts->model) @@ -654,7 +650,6 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em gtk_table_set_row_spacing (GTK_TABLE (mts), 4, 12); /* Allocate the colors. */ - visual = gtk_widget_get_visual (GTK_WIDGET (mts)); colormap = gtk_widget_get_colormap (GTK_WIDGET (mts)); e_meeting_time_selector_alloc_named_color (mts, "gray75", &mts->bg_color); e_meeting_time_selector_alloc_named_color (mts, "gray50", &mts->all_attendees_bg_color); @@ -2051,12 +2046,10 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) gint max_date_width, longest_weekday_width, longest_month_width, width; gint day, longest_weekday, month, longest_month; gchar buffer[128]; - PangoFontDescription *font_desc; PangoContext *pango_context; PangoLayout *layout; /* Set up Pango prerequisites */ - font_desc = gtk_widget_get_style (GTK_WIDGET (mts))->font_desc; pango_context = gtk_widget_get_pango_context (GTK_WIDGET (mts)); layout = pango_layout_new (pango_context); diff --git a/calendar/gui/e-memo-table-config.c b/calendar/gui/e-memo-table-config.c index cb3ef06132..064ef0810f 100644 --- a/calendar/gui/e-memo-table-config.c +++ b/calendar/gui/e-memo-table-config.c @@ -30,7 +30,7 @@ struct _EMemoTableConfigPrivate { GList *notifications; }; -G_DEFINE_TYPE (EMemoTableConfig, e_memo_table_config, G_TYPE_OBJECT); +G_DEFINE_TYPE (EMemoTableConfig, e_memo_table_config, G_TYPE_OBJECT) /* Property IDs */ enum props { @@ -42,10 +42,8 @@ static void e_memo_table_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { EMemoTableConfig *table_config; - EMemoTableConfigPrivate *priv; table_config = E_MEMO_TABLE_CONFIG (object); - priv = table_config->priv; switch (property_id) { case PROP_TABLE: @@ -61,10 +59,8 @@ static void e_memo_table_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { EMemoTableConfig *table_config; - EMemoTableConfigPrivate *priv; table_config = E_MEMO_TABLE_CONFIG (object); - priv = table_config->priv; switch (property_id) { case PROP_TABLE: @@ -80,9 +76,6 @@ static void e_memo_table_config_dispose (GObject *object) { EMemoTableConfig *table_config = E_MEMO_TABLE_CONFIG (object); - EMemoTableConfigPrivate *priv; - - priv = table_config->priv; e_memo_table_config_set_table (table_config, NULL); diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index bd14f3cbee..7a8fae5b9f 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -109,17 +109,15 @@ static GdkPixbuf* icon_pixbufs[E_MEMO_MODEL_NUM_ICONS] = { 0 }; static GdkAtom clipboard_atom = GDK_NONE; -G_DEFINE_TYPE (EMemoTable, e_memo_table, GTK_TYPE_TABLE); +G_DEFINE_TYPE (EMemoTable, e_memo_table, GTK_TYPE_TABLE) static void e_memo_table_class_init (EMemoTableClass *klass) { GtkObjectClass *object_class; - GtkWidgetClass *widget_class; object_class = (GtkObjectClass *) klass; - widget_class = (GtkWidgetClass *) klass; /* Method override */ object_class->destroy = e_memo_table_destroy; @@ -147,7 +145,7 @@ e_memo_table_class_init (EMemoTableClass *klass) * Also, this assumes it is passed pointers to ECalComponents, but I think it * may just be passed pointers to the 2 cell values. */ -/* +#if 0 static gint task_compare_cb (gconstpointer a, gconstpointer b) { @@ -168,7 +166,7 @@ task_compare_cb (gconstpointer a, gconstpointer b) int v; /* FIXME: TIMEZONES. But currently we have no way to get the - ECal, so we can't get the timezone. * + ECal, so we can't get the timezone. */ v = icaltime_compare (*due_a.value, *due_b.value); if (v == 0) @@ -193,7 +191,7 @@ task_compare_cb (gconstpointer a, gconstpointer b) return retval; } -*/ +#endif static void row_appended_cb (ECalModel *model, EMemoTable *memo_table) diff --git a/calendar/gui/e-memos.c b/calendar/gui/e-memos.c index c4b4041284..2ba20ba327 100644 --- a/calendar/gui/e-memos.c +++ b/calendar/gui/e-memos.c @@ -120,7 +120,7 @@ static const int num_list_drag_types = sizeof (list_drag_types) / sizeof (list_d static guint e_memos_signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (EMemos, e_memos, GTK_TYPE_TABLE); +G_DEFINE_TYPE (EMemos, e_memos, GTK_TYPE_TABLE) /* Callback used when the cursor changes in the table */ static void @@ -272,8 +272,6 @@ update_view (EMemos *memos) { EMemosPrivate *priv; ECalModel *model; - char *real_sexp = NULL; - char *new_sexp = NULL; priv = memos->priv; @@ -717,12 +715,10 @@ static void backend_error_cb (ECal *client, const char *message, gpointer data) { EMemos *memos; - EMemosPrivate *priv; char *errmsg; char *urinopwd; memos = E_MEMOS (data); - priv = memos->priv; urinopwd = get_uri_without_password (e_cal_get_uri (client)); errmsg = g_strdup_printf (_("Error on %s:\n %s"), urinopwd, message); @@ -854,10 +850,6 @@ typedef void (*open_func) (ECal *, ECalendarStatus, EMemos *); static gboolean open_ecal (EMemos *memos, ECal *cal, gboolean only_if_exists, open_func of) { - EMemosPrivate *priv; - - priv = memos->priv; - set_status_message (memos, _("Opening memos at %s"), e_cal_get_uri (cal)); g_signal_connect (G_OBJECT (cal), "cal_opened", G_CALLBACK (of), memos); diff --git a/calendar/gui/e-mini-calendar-config.c b/calendar/gui/e-mini-calendar-config.c index 120f3dba84..c106d8c601 100644 --- a/calendar/gui/e-mini-calendar-config.c +++ b/calendar/gui/e-mini-calendar-config.c @@ -35,16 +35,14 @@ enum props { PROP_CALENDAR }; -G_DEFINE_TYPE (EMiniCalendarConfig, e_mini_calendar_config, G_TYPE_OBJECT); +G_DEFINE_TYPE (EMiniCalendarConfig, e_mini_calendar_config, G_TYPE_OBJECT) static void e_mini_calendar_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { EMiniCalendarConfig *mini_config; - EMiniCalendarConfigPrivate *priv; mini_config = E_MINI_CALENDAR_CONFIG (object); - priv = mini_config->priv; switch (property_id) { case PROP_CALENDAR: @@ -60,10 +58,8 @@ static void e_mini_calendar_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { EMiniCalendarConfig *mini_config; - EMiniCalendarConfigPrivate *priv; mini_config = E_MINI_CALENDAR_CONFIG (object); - priv = mini_config->priv; switch (property_id) { case PROP_CALENDAR: @@ -79,10 +75,7 @@ static void e_mini_calendar_config_dispose (GObject *object) { EMiniCalendarConfig *mini_config = E_MINI_CALENDAR_CONFIG (object); - EMiniCalendarConfigPrivate *priv; - priv = mini_config->priv; - e_mini_calendar_config_set_calendar (mini_config, NULL); if (G_OBJECT_CLASS (e_mini_calendar_config_parent_class)->dispose) diff --git a/calendar/gui/e-pub-utils.c b/calendar/gui/e-pub-utils.c index ab39e13d81..27f723a63c 100644 --- a/calendar/gui/e-pub-utils.c +++ b/calendar/gui/e-pub-utils.c @@ -136,7 +136,7 @@ e_pub_uri_to_xml (EPublishUri *uri) static gboolean is_publish_time (EPublishUri *uri) { icaltimezone *utc; - struct icaltimetype current_itt, adjust_itt; + struct icaltimetype current_itt; utc = icaltimezone_get_utc_timezone (); current_itt = icaltime_current_time_with_zone (utc); @@ -191,7 +191,7 @@ e_pub_publish (gboolean publish) { uri_config_list = calendar_config_get_free_busy (); for (l = uri_config_list; l != NULL; l = l->next) { - GSList *p =NULL, *q; + GSList *p = NULL, *q; EPublishUri *uri; ECalComponent *clone = NULL; gboolean cloned = FALSE; @@ -206,7 +206,7 @@ e_pub_publish (gboolean publish) { e_pub_uri_from_xml (uri, xml); /*FIXME this is just a hack to avoid publishing again and again - ,we need to make the last publish time a seperate key */ + we need to make the last publish time a seperate key */ if (updated_last_pub_time) { updated_last_pub_time = FALSE; return; @@ -284,10 +284,10 @@ e_pub_publish (gboolean publish) { if (e_cal_get_free_busy ((ECal *) client, users, start, end, &comp_list, &error)) { - GList *l; - - for (l = comp_list; l; l = l->next) { - ECalComponent *comp = E_CAL_COMPONENT (l->data); + GList *list; + + for (list = comp_list; list; list = list->next) { + ECalComponent *comp = E_CAL_COMPONENT (list->data); cloned = itip_publish_begin (comp, (ECal *) client, cloned, &clone); g_object_unref (comp); diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 8a6cc8856c..0b10001fc0 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -306,15 +306,12 @@ static void process_completed_tasks (ETasks *tasks, gboolean config_changed) { ETasksPrivate *priv; - ECalModel *model; g_return_if_fail (tasks != NULL); g_return_if_fail (E_IS_TASKS (tasks)); priv = tasks->priv; - model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)); - e_calendar_table_process_completed_tasks (e_tasks_get_calendar_table (tasks), priv->clients_list, config_changed); } @@ -812,12 +809,10 @@ static void backend_error_cb (ECal *client, const char *message, gpointer data) { ETasks *tasks; - ETasksPrivate *priv; char *errmsg; char *urinopwd; tasks = E_TASKS (data); - priv = tasks->priv; urinopwd = get_uri_without_password (e_cal_get_uri (client)); errmsg = g_strdup_printf (_("Error on %s:\n %s"), urinopwd, message); diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index 56ac16901d..e7dd3682c1 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -77,7 +77,7 @@ static void e_timezone_entry_set_entry (ETimezoneEntry *tentry); static guint timezone_entry_signals[LAST_SIGNAL] = { 0 }; -G_DEFINE_TYPE (ETimezoneEntry, e_timezone_entry, GTK_TYPE_HBOX); +G_DEFINE_TYPE (ETimezoneEntry, e_timezone_entry, GTK_TYPE_HBOX) static void e_timezone_entry_class_init (ETimezoneEntryClass *class) @@ -164,12 +164,10 @@ static void e_timezone_entry_destroy (GtkObject *object) { ETimezoneEntry *tentry; - ETimezoneEntryPrivate *priv; g_return_if_fail (E_IS_TIMEZONE_ENTRY (object)); tentry = E_TIMEZONE_ENTRY (object); - priv = tentry->priv; g_free (tentry->priv); tentry->priv = NULL; diff --git a/calendar/gui/e-week-view-config.c b/calendar/gui/e-week-view-config.c index e93f44373e..1f92ec8197 100644 --- a/calendar/gui/e-week-view-config.c +++ b/calendar/gui/e-week-view-config.c @@ -36,16 +36,14 @@ enum props { PROP_VIEW, }; -G_DEFINE_TYPE (EWeekViewConfig, e_week_view_config, G_TYPE_OBJECT); +G_DEFINE_TYPE (EWeekViewConfig, e_week_view_config, G_TYPE_OBJECT) static void e_week_view_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { EWeekViewConfig *view_config; - EWeekViewConfigPrivate *priv; view_config = E_WEEK_VIEW_CONFIG (object); - priv = view_config->priv; switch (property_id) { case PROP_VIEW: @@ -61,10 +59,8 @@ static void e_week_view_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { EWeekViewConfig *view_config; - EWeekViewConfigPrivate *priv; view_config = E_WEEK_VIEW_CONFIG (object); - priv = view_config->priv; switch (property_id) { case PROP_VIEW: @@ -80,9 +76,6 @@ static void e_week_view_config_dispose (GObject *object) { EWeekViewConfig *view_config = E_WEEK_VIEW_CONFIG (object); - EWeekViewConfigPrivate *priv; - - priv = view_config->priv; e_week_view_config_set_view (view_config, NULL); diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 5b3312e696..d671b2e876 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -95,7 +95,7 @@ enum { ARG_SPAN_NUM }; -G_DEFINE_TYPE (EWeekViewEventItem, e_week_view_event_item, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EWeekViewEventItem, e_week_view_event_item, GNOME_TYPE_CANVAS_ITEM) static void e_week_view_event_item_class_init (EWeekViewEventItemClass *class) @@ -219,7 +219,6 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item, EWeekView *week_view; EWeekViewEvent *event; EWeekViewEventSpan *span; - GtkStyle *style; GdkGC *gc; gint x1, y1, x2, y2, time_x, time_y; gint icon_x, icon_y, time_width, min_end_time_x, max_icon_x; @@ -253,7 +252,6 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item, span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + wveitem->span_num); - style = GTK_WIDGET (week_view)->style; gc = week_view->main_gc; x1 = canvas_item->x1 - x; @@ -591,7 +589,6 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, { EWeekView *week_view; EWeekViewEvent *event; - EWeekViewEventSpan *span; ECalComponent *comp; GdkGC *gc; gint num_icons = 0, icon_x_inc; @@ -603,8 +600,6 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, event = &g_array_index (week_view->events, EWeekViewEvent, wveitem->event_num); - span = &g_array_index (week_view->spans, EWeekViewEventSpan, - event->spans_index + wveitem->span_num); comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index 06669b5ecb..ca6812b463 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -30,6 +30,7 @@ #include <config.h> #endif +#include <string.h> #include <glib.h> #include <libgnome/gnome-i18n.h> #include "e-week-view-main-item.h" @@ -69,7 +70,7 @@ enum { ARG_WEEK_VIEW }; -G_DEFINE_TYPE (EWeekViewMainItem, e_week_view_main_item, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EWeekViewMainItem, e_week_view_main_item, GNOME_TYPE_CANVAS_ITEM) static void e_week_view_main_item_class_init (EWeekViewMainItemClass *class) @@ -106,10 +107,8 @@ e_week_view_main_item_init (EWeekViewMainItem *wvmitem) static void e_week_view_main_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) { - GnomeCanvasItem *item; EWeekViewMainItem *wvmitem; - item = GNOME_CANVAS_ITEM (o); wvmitem = E_WEEK_VIEW_MAIN_ITEM (o); switch (arg_id){ diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c index c688cb9025..5404a003da 100644 --- a/calendar/gui/e-week-view-titles-item.c +++ b/calendar/gui/e-week-view-titles-item.c @@ -59,7 +59,7 @@ enum { ARG_WEEK_VIEW }; -G_DEFINE_TYPE (EWeekViewTitlesItem, e_week_view_titles_item, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EWeekViewTitlesItem, e_week_view_titles_item, GNOME_TYPE_CANVAS_ITEM) static void e_week_view_titles_item_class_init (EWeekViewTitlesItemClass *class) @@ -93,10 +93,8 @@ e_week_view_titles_item_init (EWeekViewTitlesItem *wvtitem) static void e_week_view_titles_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) { - GnomeCanvasItem *item; EWeekViewTitlesItem *wvtitem; - item = GNOME_CANVAS_ITEM (o); wvtitem = E_WEEK_VIEW_TITLES_ITEM (o); switch (arg_id){ @@ -139,7 +137,7 @@ e_week_view_titles_item_draw (GnomeCanvasItem *canvas_item, EWeekViewTitlesItem *wvtitem; EWeekView *week_view; GtkStyle *style; - GdkGC *fg_gc, *bg_gc, *light_gc, *dark_gc; + GdkGC *fg_gc, *light_gc, *dark_gc; gint canvas_width, canvas_height, col_width, col, date_width, date_x; gchar buffer[128], *date_format; GDate date; @@ -159,7 +157,6 @@ e_week_view_titles_item_draw (GnomeCanvasItem *canvas_item, style = gtk_widget_get_style (GTK_WIDGET (week_view)); fg_gc = style->fg_gc[GTK_STATE_NORMAL]; - bg_gc = style->bg_gc[GTK_STATE_NORMAL]; light_gc = style->light_gc[GTK_STATE_NORMAL]; dark_gc = style->dark_gc[GTK_STATE_NORMAL]; canvas_width = GTK_WIDGET (canvas_item->canvas)->allocation.width; diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index e1ba4b14b3..ccfde3af78 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -168,9 +168,6 @@ static gboolean e_week_view_find_event_from_uid (EWeekView *week_view, typedef gboolean (* EWeekViewForeachEventCallback) (EWeekView *week_view, gint event_num, gpointer data); -static void e_week_view_foreach_event (EWeekView *week_view, - EWeekViewForeachEventCallback callback, - gpointer data); static void e_week_view_foreach_event_with_uid (EWeekView *week_view, const gchar *uid, EWeekViewForeachEventCallback callback, @@ -188,7 +185,6 @@ static gboolean e_week_view_on_jump_button_event (GnomeCanvasItem *item, static gboolean e_week_view_key_press (GtkWidget *widget, GdkEventKey *event); static gboolean e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event); -static void e_week_view_move_selection_day (EWeekView *week_view, ECalViewMoveDirection direction); static gint e_week_view_get_adjust_days_for_move_up (EWeekView *week_view, gint current_day); static gint e_week_view_get_adjust_days_for_move_down (EWeekView *week_view,gint current_day); @@ -196,9 +192,6 @@ static gint e_week_view_get_adjust_days_for_move_left (EWeekView *week_view,gint static gint e_week_view_get_adjust_days_for_move_right (EWeekView *week_view,gint current_day); static gboolean e_week_view_popup_menu (GtkWidget *widget); -static gboolean e_week_view_update_event_cb (EWeekView *week_view, - gint event_num, - gpointer data); static gboolean e_week_view_remove_event_cb (EWeekView *week_view, gint event_num, gpointer data); @@ -208,7 +201,7 @@ static void e_week_view_queue_layout (EWeekView *week_view); static void e_week_view_cancel_layout (EWeekView *week_view); static gboolean e_week_view_layout_timeout_cb (gpointer data); -G_DEFINE_TYPE (EWeekView, e_week_view, E_TYPE_CALENDAR_VIEW); +G_DEFINE_TYPE (EWeekView, e_week_view, E_TYPE_CALENDAR_VIEW) static void e_week_view_class_init (EWeekViewClass *class) @@ -306,9 +299,9 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo static void process_component (EWeekView *week_view, ECalModelComponent *comp_data) { - gint num_days; ECalComponent *comp = NULL; AddEventData add_event_data; + /* rid is never used in this function? */ const char *uid, *rid; /* If we don't have a valid date set yet, just return. */ @@ -330,8 +323,6 @@ process_component (EWeekView *week_view, ECalModelComponent *comp_data) rid = NULL; /* Add the object */ - num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7; - add_event_data.week_view = week_view; add_event_data.comp_data = comp_data; e_week_view_add_event (comp, comp_data->instance_start, comp_data->instance_end, FALSE, &add_event_data); @@ -1803,6 +1794,7 @@ e_week_view_recalc_display_start_day (EWeekView *week_view) return FALSE; } +#if 0 /* Checks if the users participation status is Needs action and shows the summary as bold text*/ static void set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) @@ -1836,66 +1828,7 @@ set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) g_object_unref (comp); g_free (address); } - -static gboolean -e_week_view_update_event_cb (EWeekView *week_view, - gint event_num, - gpointer data) -{ - EWeekViewEvent *event; - EWeekViewEventSpan *span; - gint span_num; - const gchar *text; - ECalModelComponent *comp_data; - - comp_data = data; - - event = &g_array_index (week_view->events, EWeekViewEvent, event_num); - - e_cal_model_free_component_data (event->comp_data); - event->comp_data = e_cal_model_copy_component_data (comp_data); - - for (span_num = 0; span_num < event->num_spans; span_num++) { - span = &g_array_index (week_view->spans, EWeekViewEventSpan, - event->spans_index + span_num); - - if (span->text_item) { - text = icalcomponent_get_summary (comp_data->icalcomp); - gnome_canvas_item_set (span->text_item, - "text", text ? text : "", - NULL); - - e_week_view_reshape_event_span (week_view, event_num, - span_num); - } - } - g_signal_emit_by_name (G_OBJECT(week_view), - "event_changed", event); - - - return TRUE; -} - -/* This calls a given function for each event instance Note that it is - safe for the callback to remove the event (since we step backwards - through the arrays). */ -static void -e_week_view_foreach_event (EWeekView *week_view, - EWeekViewForeachEventCallback callback, - gpointer data) -{ - EWeekViewEvent *event; - gint event_num; - - for (event_num = week_view->events->len - 1; - event_num >= 0; - event_num--) { - event = &g_array_index (week_view->events, EWeekViewEvent, event_num); - - if (!(*callback) (week_view, event_num, data)) - return; - } -} +#endif /* This calls a given function for each event instance that matches the given uid. Note that it is safe for the callback to remove the event (since we @@ -2155,11 +2088,11 @@ e_week_view_on_scroll (GtkWidget *widget, { GtkAdjustment *adj = GTK_RANGE (week_view->vscrollbar)->adjustment; gfloat new_value; - GtkWidget *tool_window = g_object_get_data (week_view, "tooltip-window"); + GtkWidget *tool_window = g_object_get_data (G_OBJECT (week_view), "tooltip-window"); if (tool_window) { gtk_widget_destroy (tool_window); - g_object_set_data (week_view, "tooltip-window", NULL); + g_object_set_data (G_OBJECT (week_view), "tooltip-window", NULL); } switch (scroll->direction){ @@ -2568,12 +2501,12 @@ tooltip_get_view_event (EWeekView *week_view, int day, int event_num) static void tooltip_destroy (EWeekView *week_view, GnomeCanvasItem *item) { - int event_num = GPOINTER_TO_INT (g_object_get_data (item, "event-num")); + int event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; pevent = tooltip_get_view_event (week_view, -1, event_num); if (pevent) { - if (pevent->tooltip && g_object_get_data (week_view, "tooltip-window")) { + if (pevent->tooltip && g_object_get_data (G_OBJECT (week_view), "tooltip-window")) { gtk_widget_destroy (pevent->tooltip); pevent->tooltip = NULL; } @@ -2582,7 +2515,7 @@ tooltip_destroy (EWeekView *week_view, GnomeCanvasItem *item) g_source_remove (pevent->timeout); pevent->timeout = -1; } - g_object_set_data (week_view, "tooltip-window", NULL); + g_object_set_data (G_OBJECT (week_view), "tooltip-window", NULL); } } @@ -2591,7 +2524,7 @@ tooltip_event_cb (GnomeCanvasItem *item, GdkEvent *event, EWeekView *view) { - int event_num = GPOINTER_TO_INT (g_object_get_data (item, "event-num")); + int event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; pevent = tooltip_get_view_event (view, -1, event_num); @@ -2618,7 +2551,7 @@ tooltip_event_cb (GnomeCanvasItem *item, case GDK_MOTION_NOTIFY: pevent->x = ((GdkEventMotion *)event)->x_root; pevent->y = ((GdkEventMotion *)event)->y_root; - pevent->tooltip = (GtkWidget *)g_object_get_data (view, "tooltip-window"); + pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (view), "tooltip-window"); if (pevent->tooltip) { gtk_window_move ((GtkWindow *)pevent->tooltip, ((int)((GdkEventMotion *)event)->x_root)+16, ((int)((GdkEventMotion *)event)->y_root) +16); @@ -2632,8 +2565,6 @@ tooltip_event_cb (GnomeCanvasItem *item, default: return FALSE; } - - return FALSE; } static void @@ -2730,7 +2661,7 @@ e_week_view_reshape_event_span (EWeekView *week_view, NULL); } - g_object_set_data ((GObject *)span->background_item, "event-num", event_num); + g_object_set_data ((GObject *)span->background_item, "event-num", GINT_TO_POINTER (event_num)); g_signal_connect (span->background_item, "event", G_CALLBACK (tooltip_event_cb), week_view); @@ -2742,11 +2673,11 @@ e_week_view_reshape_event_span (EWeekView *week_view, /* Create the text item if necessary. */ if (!span->text_item) { - ECalComponentText text; + ECalComponentText cal_text; GtkWidget *widget; widget = (GtkWidget *)week_view; - e_cal_component_get_summary (comp, &text); + e_cal_component_get_summary (comp, &cal_text); span->text_item = gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), e_text_get_type (), @@ -2754,7 +2685,7 @@ e_week_view_reshape_event_span (EWeekView *week_view, "clip", TRUE, "max_lines", 1, "editable", TRUE, - "text", text.value ? text.value : "", + "text", cal_text.value ? cal_text.value : "", "use_ellipsis", TRUE, "fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL], "im_context", E_CANVAS (week_view->main_canvas)->im_context, @@ -2765,7 +2696,7 @@ e_week_view_reshape_event_span (EWeekView *week_view, && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) { set_text_as_bold (event, span); } */ - g_object_set_data ((GObject *)span->text_item, "event-num", event_num); + g_object_set_data (G_OBJECT (span->text_item), "event-num", GINT_TO_POINTER (event_num)); g_signal_connect (span->text_item, "event", G_CALLBACK (e_week_view_on_text_item_event), week_view); @@ -3034,7 +2965,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, { EWeekViewEvent *event; gint event_num, span_num; - int nevent = GPOINTER_TO_INT (g_object_get_data (item, "event-num")); + int nevent = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; pevent = tooltip_get_view_event (week_view, -1, nevent); @@ -3167,7 +3098,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, return FALSE; - g_object_set_data ((GObject *)item, "event-num", nevent); + g_object_set_data ((GObject *)item, "event-num", GINT_TO_POINTER (nevent)); pevent = tooltip_get_view_event (week_view, -1, nevent); @@ -3192,7 +3123,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, case GDK_MOTION_NOTIFY: pevent->x = ((GdkEventMotion *)gdkevent)->x_root; pevent->y = ((GdkEventMotion *)gdkevent)->y_root; - pevent->tooltip = (GtkWidget *)g_object_get_data (week_view, "tooltip-window"); + pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (week_view), "tooltip-window"); if (pevent->tooltip) gtk_window_move ((GtkWindow *)pevent->tooltip, ((int)((GdkEventMotion *)gdkevent)->x_root)+16, ((int)((GdkEventMotion *)gdkevent)->y_root) +16); @@ -3216,14 +3147,13 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, static gboolean e_week_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) { EWeekViewEvent *event; - gint event_num, span_num, adjust_days, current_start_day, current_end_day; + gint event_num, adjust_days, current_start_day, current_end_day; time_t start_dt, end_dt; struct icaltimetype start_time,end_time; EWeekView *week_view = E_WEEK_VIEW (cal_view); gboolean is_all_day = FALSE; event_num = week_view->editing_event_num; - span_num = week_view->editing_span_num; adjust_days = 0; /* If no item is being edited, just return. */ @@ -3471,8 +3401,6 @@ e_week_view_on_editing_stopped (EWeekView *week_view, on_server = cal_comp_is_on_server (comp, client); if (string_is_empty (text) && !on_server) { - const char *uid; - e_cal_component_get_uid (comp, &uid); e_week_view_foreach_event_with_uid (week_view, uid, @@ -3988,13 +3916,13 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) gtk_widget_queue_draw (week_view->main_canvas); if (e_week_view_find_event_from_uid (week_view, ecal, uid, NULL, &event_num)) { - EWeekViewEvent *event; + EWeekViewEvent *wvevent; EWeekViewEventSpan *span; - event = &g_array_index (week_view->events, EWeekViewEvent, - event_num); + wvevent = &g_array_index (week_view->events, EWeekViewEvent, + event_num); span = &g_array_index (week_view->spans, EWeekViewEventSpan, - event->spans_index + 0); + wvevent->spans_index + 0); /* If the event can't be fit on the screen, don't try to edit it. */ if (!span->text_item) { @@ -4017,58 +3945,6 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) return TRUE; } -static void -e_week_view_move_selection_day (EWeekView *week_view, ECalViewMoveDirection direction) -{ - gint selection_start_day, selection_end_day; - - selection_start_day = week_view->selection_start_day; - selection_end_day = week_view->selection_end_day; - - if (selection_start_day == -1) { - selection_start_day = 0; - selection_end_day = 0; - } - - switch (direction) { - case E_CAL_VIEW_MOVE_UP: - selection_end_day += e_week_view_get_adjust_days_for_move_up (week_view,selection_end_day); - break; - case E_CAL_VIEW_MOVE_DOWN: - selection_end_day += e_week_view_get_adjust_days_for_move_down (week_view,selection_end_day); - break; - case E_CAL_VIEW_MOVE_LEFT: - selection_end_day += e_week_view_get_adjust_days_for_move_left (week_view,selection_end_day); - break; - case E_CAL_VIEW_MOVE_RIGHT: - selection_end_day += e_week_view_get_adjust_days_for_move_right (week_view,selection_end_day); - break; - default: - break; - } - if (selection_end_day < 0) { - e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_UP); - selection_end_day +=7; - } - if (week_view->multi_week_view) { - if (selection_end_day >= week_view->weeks_shown * 7) { - e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_DOWN); - selection_end_day -=7; - } - }else { - if (selection_end_day >= 7) { - e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_DOWN); - selection_end_day -=7; - } - } - - week_view->selection_start_day = selection_end_day; - week_view->selection_end_day = selection_end_day; - - gtk_widget_queue_draw (week_view->main_canvas); - g_signal_emit_by_name (week_view, "selected_time_changed"); -} - static gint e_week_view_get_adjust_days_for_move_up (EWeekView *week_view,gint current_day) { diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index c32a36bafd..6815787cfc 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -233,7 +233,7 @@ static void update_query (GnomeCalendar *gcal); static void update_todo_view (GnomeCalendar *gcal); -G_DEFINE_TYPE (GnomeCalendar, gnome_calendar, GTK_TYPE_VBOX); +G_DEFINE_TYPE (GnomeCalendar, gnome_calendar, GTK_TYPE_VBOX) /* Class initialization function for the gnome calendar */ static void @@ -504,10 +504,8 @@ static void dn_e_cal_view_objects_modified_cb (ECalView *query, GList *objects, gpointer data) { GnomeCalendar *gcal; - GnomeCalendarPrivate *priv; gcal = GNOME_CALENDAR (data); - priv = gcal->priv; /* We have to retag the whole thing: an event may change dates * and the tag_calendar_by_comp() below would not know how to @@ -532,10 +530,6 @@ dn_e_cal_view_objects_removed_cb (ECalView *query, GList *ids, gpointer data) static void dn_e_cal_view_done_cb (ECalView *query, ECalendarStatus status, gpointer data) { - GnomeCalendar *gcal; - - gcal = GNOME_CALENDAR (data); - /* FIXME Better error reporting */ if (status != E_CALENDAR_STATUS_OK) g_warning (G_STRLOC ": Query did not successfully complete"); @@ -1030,11 +1024,9 @@ static void table_selection_change_cb (ETable *etable, gpointer data) { GnomeCalendar *gcal; - int n_selected; gcal = GNOME_CALENDAR (data); - n_selected = e_table_selected_count (etable); gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals[TASKPAD_SELECTION_CHANGED]); } @@ -1882,10 +1874,6 @@ gnome_calendar_dayjump (GnomeCalendar *gcal, time_t time) static void focus_current_view (GnomeCalendar *gcal) { - GnomeCalendarPrivate *priv; - - priv = gcal->priv; - gtk_widget_grab_focus (gnome_calendar_get_current_view_widget (gcal)); } @@ -2560,12 +2548,10 @@ static void backend_error_cb (ECal *client, const char *message, gpointer data) { GnomeCalendar *gcal; - GnomeCalendarPrivate *priv; char *errmsg; char *uristr; gcal = GNOME_CALENDAR (data); - priv = gcal->priv; uristr = get_uri_without_password (e_cal_get_uri (client)); errmsg = g_strdup_printf (_("Error on %s:\n %s"), uristr, message); @@ -2914,10 +2900,6 @@ gnome_calendar_set_selected_time_range (GnomeCalendar *gcal, time_t start_time, time_t end_time) { - GnomeCalendarPrivate *priv; - - priv = gcal->priv; - update_view_times (gcal, start_time); gnome_calendar_update_date_navigator (gcal); gnome_calendar_notify_dates_shown_changed (gcal); @@ -3000,10 +2982,6 @@ gnome_calendar_get_current_time_range (GnomeCalendar *gcal, time_t *start_time, time_t *end_time) { - GnomeCalendarPrivate *priv; - - priv = gcal->priv; - e_calendar_view_get_selected_time_range (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)), start_time, end_time); } @@ -3016,13 +2994,10 @@ gnome_calendar_get_visible_time_range (GnomeCalendar *gcal, time_t *start_time, time_t *end_time) { - GnomeCalendarPrivate *priv; gboolean retval = FALSE; g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE); - priv = gcal->priv; - retval = e_calendar_view_get_visible_time_range (E_CALENDAR_VIEW (gnome_calendar_get_current_view_widget (gcal)), start_time, end_time); @@ -3408,14 +3383,11 @@ gnome_calendar_delete_selection (GnomeCalendar *gcal) void gnome_calendar_delete_selected_occurrence (GnomeCalendar *gcal) { - GnomeCalendarPrivate *priv; FocusLocation location; GtkWidget *view; g_return_if_fail (GNOME_IS_CALENDAR (gcal)); - priv = gcal->priv; - location = get_focus_location (gcal); if (location == FOCUS_CALENDAR) { diff --git a/calendar/gui/goto.c b/calendar/gui/goto.c index 5d7d4ec659..6397a02282 100644 --- a/calendar/gui/goto.c +++ b/calendar/gui/goto.c @@ -200,7 +200,6 @@ goto_dialog_init_widgets (GoToDialog *dlg) void goto_dialog (GnomeCalendar *gcal) { - GtkWidget *menu; time_t start_time; struct icaltimetype tt; int b; @@ -237,7 +236,6 @@ goto_dialog (GnomeCalendar *gcal) dlg->month_val = tt.month - 1; dlg->day_val = tt.day; - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month)); gtk_option_menu_set_history (GTK_OPTION_MENU (dlg->month), dlg->month_val); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->year), dlg->year_val); diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 181b46af60..67b886892b 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -620,7 +620,7 @@ comp_subject (ECalComponentItipMethod method, ECalComponent *comp) GSList *alist, *l; CORBA_char *subject; char *sender; - ECalComponentAttendee *a; + ECalComponentAttendee *a = NULL; e_cal_component_get_summary (comp, &caltext); if (caltext.value != NULL) @@ -1443,8 +1443,6 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp e_cal_component_get_dtstart (comp, &dtstart); if (dtstart.value) { - struct tm *tm_time; - start_zone = icaltimezone_get_builtin_timezone_from_tzid (dtstart.tzid); if (!start_zone) { if (!e_cal_get_timezone (client, dtstart.tzid, &start_zone, NULL)) @@ -1679,7 +1677,7 @@ comp_fb_normalize (icalcomponent *icomp) } return iclone; - + /* this will never be reached */ g_object_unref (iclone); return NULL; } diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c index 04178500cb..24ca448907 100644 --- a/calendar/gui/memos-component.c +++ b/calendar/gui/memos-component.c @@ -903,12 +903,9 @@ static gboolean create_new_memo (MemosComponent *memo_component, gboolean is_assigned, MemosComponentView *component_view) { ECal *ecal; - MemosComponentPrivate *priv; ECalComponent *comp; MemoEditor *editor; - priv = memo_component->priv; - ecal = setup_create_ecal (memo_component, component_view); if (!ecal) return FALSE; @@ -1179,9 +1176,6 @@ impl_requestCreateItem (PortableServer_Servant servant, CORBA_Environment *ev) { MemosComponent *memos_component = MEMOS_COMPONENT (bonobo_object_from_servant (servant)); - MemosComponentPrivate *priv; - - priv = memos_component->priv; if (strcmp (item_type_name, CREATE_MEMO_ID) == 0) { if (!create_new_memo (memos_component, FALSE, NULL)) diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c index a9ac9de2af..cdb19dc8a8 100644 --- a/calendar/gui/migration.c +++ b/calendar/gui/migration.c @@ -1125,7 +1125,7 @@ migrate_memos (MemosComponent *component, int major, int minor, int revision, st e_source_list_sync (memos_component_peek_source_list (component), NULL); retval = TRUE; -fail: + if (on_this_computer) g_object_unref (on_this_computer); if (on_the_web) diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 98a62c0c11..6c07bb2a98 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -560,7 +560,6 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, time_t month, int bordertitle) { icaltimezone *zone = calendar_config_get_icaltimezone (); - ECal *client; GnomeFont *font, *font_bold, *font_normal; time_t now, next; int x, y; @@ -589,8 +588,6 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, time_t month, top -= header_size; - client = gnome_calendar_get_default_client (gcal); - col_width = (right - left) / 7; /* The top row with the day abbreviations gets an extra bit of @@ -605,6 +602,7 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, time_t month, twice as high as they are wide, but we need to fit two characters into each cell, so we don't want to go over col_width. */ max_font_size = col_width * 0.65; + /* Why calculate this if we're not using it? */ font_size = row_height; @@ -1189,7 +1187,6 @@ print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence, /* Also print events outside of work hours */ if (pdi.events[0]->len > 0) { - icaltimezone *zone = calendar_config_get_icaltimezone (); struct icaltimetype tt; event = &g_array_index (pdi.events[0], EDayViewEvent, 0); @@ -1809,7 +1806,6 @@ print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t start, time_t end, double left, double right, double top, double bottom) { - ECal *client; GnomeFont *font_summary; double y, yend, x, xend; struct icaltimetype *tt; @@ -1823,7 +1819,6 @@ print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal, task_pad = gnome_calendar_get_task_pad (gcal); table = e_calendar_table_get_table (task_pad); model = e_calendar_table_get_model (task_pad); - client = e_cal_model_get_default_client (model); font_summary = get_font_for_size (10, GNOME_FONT_BOOK, FALSE); @@ -2381,28 +2376,28 @@ print_comp_item (GnomePrintContext *pc, ECalComponent *comp, ECal *client, } if (status_string) { - char *text = g_strdup_printf (_("Status: %s"), + char *status_text = g_strdup_printf (_("Status: %s"), status_string); - top = bound_text (pc, font, text, + top = bound_text (pc, font, status_text, left, right, top, bottom, 0); top += gnome_font_get_size (font) - 6; - g_free (text); + g_free (status_text); } } /* Priority */ e_cal_component_get_priority (comp, &priority); if (priority && *priority >= 0) { - char *priority_string, *text; + char *priority_string, *pri_text; priority_string = e_cal_util_priority_to_string (*priority); e_cal_component_free_priority (priority); - text = g_strdup_printf (_("Priority: %s"), priority_string); - top = bound_text (pc, font, text, + pri_text = g_strdup_printf (_("Priority: %s"), priority_string); + top = bound_text (pc, font, pri_text, left, right, top, bottom, 0); top += gnome_font_get_size (font) - 6; - g_free (text); + g_free (pri_text); } /* Percent Complete */ diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 021cf3dbae..965fc26430 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -909,13 +909,10 @@ static gboolean create_new_todo (TasksComponent *task_component, gboolean is_assigned, TasksComponentView *component_view) { ECal *ecal; - TasksComponentPrivate *priv; ECalComponent *comp; TaskEditor *editor; guint32 flags = 0; - priv = task_component->priv; - ecal = setup_create_ecal (task_component, component_view); if (!ecal) return FALSE; @@ -1202,9 +1199,6 @@ impl_requestCreateItem (PortableServer_Servant servant, CORBA_Environment *ev) { TasksComponent *tasks_component = TASKS_COMPONENT (bonobo_object_from_servant (servant)); - TasksComponentPrivate *priv; - - priv = tasks_component->priv; if (strcmp (item_type_name, CREATE_TASK_ID) == 0) { if (!create_new_todo (tasks_component, FALSE, NULL)) diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index 7a7e8ad85f..28454dc983 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -78,7 +78,7 @@ static void colorize_items (WeekdayPicker *wp); static guint wp_signals[LAST_SIGNAL]; -G_DEFINE_TYPE (WeekdayPicker, weekday_picker, GNOME_TYPE_CANVAS); +G_DEFINE_TYPE (WeekdayPicker, weekday_picker, GNOME_TYPE_CANVAS) /* Class initialization function for the weekday picker */ static void |