diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-01-03 12:46:23 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-01-04 02:15:01 +0800 |
commit | e77ee5d5d38ad95bce550db62bf4105f43cf88c6 (patch) | |
tree | 3b4c275b086d3f49360c551e686f62140a8ee4d4 /calendar | |
parent | 3cfd5d640908b6441769341c764de70006262c6e (diff) | |
download | gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.gz gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.bz2 gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.lz gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.xz gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.zst gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/alarm-notify/alarm.c | 3 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.h | 4 | ||||
-rw-r--r-- | calendar/gui/e-meeting-attendee.c | 13 | ||||
-rw-r--r-- | calendar/gui/e-memo-table.c | 89 | ||||
-rw-r--r-- | calendar/gui/e-week-view-main-item.c | 20 | ||||
-rw-r--r-- | calendar/gui/ea-cal-view.c | 6 | ||||
-rw-r--r-- | calendar/gui/ea-day-view-cell.c | 4 | ||||
-rw-r--r-- | calendar/gui/ea-gnome-calendar.c | 34 | ||||
-rw-r--r-- | calendar/gui/ea-jump-button.c | 3 | ||||
-rw-r--r-- | calendar/gui/ea-week-view-main-item.c | 9 |
10 files changed, 106 insertions, 79 deletions
diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c index c487d94503..9b37501ffc 100644 --- a/calendar/gui/alarm-notify/alarm.c +++ b/calendar/gui/alarm-notify/alarm.c @@ -157,7 +157,8 @@ setup_timeout (void) } -/* Used from g_list_insert_sorted(); compares the trigger times of two AlarmRecord structures. */ +/* Used from g_list_insert_sorted(); compares the + * trigger times of two AlarmRecord structures. */ static gint compare_alarm_by_time (gconstpointer a, gconstpointer b) { diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h index a7ed224fcb..3ad9565de3 100644 --- a/calendar/gui/e-calendar-view.h +++ b/calendar/gui/e-calendar-view.h @@ -98,7 +98,9 @@ struct _ECalendarView { }; typedef struct { - ECalendarViewEvent * (* get_view_event) (ECalendarView *view, gint day, gint event_num); + ECalendarViewEvent * (*get_view_event) (ECalendarView *view, + gint day, + gint event_num); ECalendarView *cal_view; gint day; gint event_num; diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c index fea2697344..7f6709ba7a 100644 --- a/calendar/gui/e-meeting-attendee.c +++ b/calendar/gui/e-meeting-attendee.c @@ -629,7 +629,8 @@ e_meeting_attendee_get_edit_level (EMeetingAttendee *ia) } void -e_meeting_attendee_set_edit_level (EMeetingAttendee *ia, EMeetingAttendeeEditLevel level) +e_meeting_attendee_set_edit_level (EMeetingAttendee *ia, + EMeetingAttendeeEditLevel level) { EMeetingAttendeePrivate *priv; @@ -706,7 +707,8 @@ e_meeting_attendee_get_has_calendar_info (EMeetingAttendee *ia) } void -e_meeting_attendee_set_has_calendar_info (EMeetingAttendee *ia, gboolean has_calendar_info) +e_meeting_attendee_set_has_calendar_info (EMeetingAttendee *ia, + gboolean has_calendar_info) { EMeetingAttendeePrivate *priv; @@ -901,8 +903,11 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, g_array_append_val (priv->busy_periods, period); - period_in_days = g_date_get_julian (&period.end.date) - g_date_get_julian (&period.start.date) + 1; - priv->longest_period_in_days = MAX (priv->longest_period_in_days, period_in_days); + period_in_days = + g_date_get_julian (&period.end.date) - + g_date_get_julian (&period.start.date) + 1; + priv->longest_period_in_days = + MAX (priv->longest_period_in_days, period_in_days); done: priv->has_calendar_info = TRUE; diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index 8461734164..94174efc3b 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -84,8 +84,6 @@ enum { LAST_SIGNAL }; -static struct tm e_memo_table_get_current_time (ECellDateEdit *ecde, gpointer data); - static gpointer parent_class; static guint signals[LAST_SIGNAL]; @@ -133,6 +131,37 @@ memo_table_emit_user_created (EMemoTable *memo_table) g_signal_emit (memo_table, signal_id, 0); } +/* Returns the current time, for the ECellDateEdit items. + FIXME: Should probably use the timezone of the item rather than the + current timezone, though that may be difficult to get from here. */ +static struct tm +memo_table_get_current_time (ECellDateEdit *ecde, + gpointer user_data) +{ + EMemoTable *memo_table = user_data; + ECalModel *model; + icaltimezone *zone; + struct tm tmp_tm = { 0 }; + struct icaltimetype tt; + + /* Get the current timezone. */ + model = e_memo_table_get_model (memo_table); + zone = e_cal_model_get_timezone (model); + + tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone); + + /* Now copy it to the struct tm and return it. */ + tmp_tm.tm_year = tt.year - 1900; + tmp_tm.tm_mon = tt.month - 1; + tmp_tm.tm_mday = tt.day; + tmp_tm.tm_hour = tt.hour; + tmp_tm.tm_min = tt.minute; + tmp_tm.tm_sec = tt.second; + tmp_tm.tm_isdst = -1; + + return tmp_tm; +} + static gint memo_table_date_compare_cb (gconstpointer a, gconstpointer b) @@ -364,7 +393,7 @@ memo_table_constructed (GObject *object) e_cell_date_edit_set_get_time_callback ( E_CELL_DATE_EDIT (popup_cell), - e_memo_table_get_current_time, memo_table, NULL); + memo_table_get_current_time, memo_table, NULL); /* Sorting */ e_table_extras_add_compare ( @@ -515,11 +544,15 @@ memo_table_query_tooltip (GtkWidget *widget, if (ptr) { ptr++; - /* To Translators: It will display "Organizer: NameOfTheUser <email@ofuser.com>" */ - tmp = g_strdup_printf (_("Organizer: %s <%s>"), organizer.cn, ptr); + /* Translators: It will display + * "Organizer: NameOfTheUser <email@ofuser.com>" */ + tmp = g_strdup_printf ( + _("Organizer: %s <%s>"), organizer.cn, ptr); } else { - /* With SunOne accounts, there may be no ':' in organiser.value */ - tmp = g_strdup_printf (_("Organizer: %s"), organizer.cn); + /* With SunOne accounts, there may be no ':' in + * organizer.value */ + tmp = g_strdup_printf ( + _("Organizer: %s"), organizer.cn); } l = gtk_label_new (tmp); @@ -535,7 +568,9 @@ memo_table_query_tooltip (GtkWidget *widget, default_zone = e_cal_model_get_timezone (model); if (dtstart.tzid) { - zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (new_comp), dtstart.tzid); + zone = icalcomponent_get_timezone ( + e_cal_component_get_icalcomponent (new_comp), + dtstart.tzid); if (!zone) e_cal_get_timezone ( comp_data->client, dtstart.tzid, &zone, NULL); @@ -1186,11 +1221,13 @@ e_memo_table_delete_selected (EMemoTable *memo_table) if (comp_data) { comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); + e_cal_component_set_icalcomponent ( + comp, icalcomponent_new_clone (comp_data->icalcomp)); } - if (delete_component_dialog (comp, FALSE, n_selected, E_CAL_COMPONENT_JOURNAL, - GTK_WIDGET (memo_table))) + if (delete_component_dialog ( + comp, FALSE, n_selected, E_CAL_COMPONENT_JOURNAL, + GTK_WIDGET (memo_table))) delete_selected_components (memo_table); /* free memory */ @@ -1220,33 +1257,3 @@ e_memo_table_get_selected (EMemoTable *memo_table) return closure.objects; } - -/* Returns the current time, for the ECellDateEdit items. - FIXME: Should probably use the timezone of the item rather than the - current timezone, though that may be difficult to get from here. */ -static struct tm -e_memo_table_get_current_time (ECellDateEdit *ecde, gpointer data) -{ - EMemoTable *memo_table = data; - ECalModel *model; - icaltimezone *zone; - struct tm tmp_tm = { 0 }; - struct icaltimetype tt; - - /* Get the current timezone. */ - model = e_memo_table_get_model (memo_table); - zone = e_cal_model_get_timezone (model); - - tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone); - - /* Now copy it to the struct tm and return it. */ - tmp_tm.tm_year = tt.year - 1900; - tmp_tm.tm_mon = tt.month - 1; - tmp_tm.tm_mday = tt.day; - tmp_tm.tm_hour = tt.hour; - tmp_tm.tm_min = tt.minute; - tmp_tm.tm_sec = tt.second; - tmp_tm.tm_isdst = -1; - - return tmp_tm; -} diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index 27a8fdb28a..04b77311d6 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -243,20 +243,25 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, cairo_save (cr); if (selected) { - gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED]); + gdk_cairo_set_source_color ( + cr, &week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED]); } else if (week_view->multi_week_view) { if (today) { - gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_TODAY]); + gdk_cairo_set_source_color ( + cr, &week_view->colors[E_WEEK_VIEW_COLOR_TODAY]); } else { - gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]); + gdk_cairo_set_source_color ( + cr, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]); } } else { - gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]); + gdk_cairo_set_source_color ( + cr, &week_view->colors[E_WEEK_VIEW_COLOR_DATES]); } if (today) { - g_date_strftime (buffer, sizeof (buffer), - format_string ? format_string : "<b>%d</b>", date); + g_date_strftime ( + buffer, sizeof (buffer), + format_string ? format_string : "<b>%d</b>", date); pango_cairo_update_context (cr, pango_context); layout = pango_cairo_create_layout (cr); pango_layout_set_font_description (layout, font_desc); @@ -284,7 +289,8 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, /* Draw the line under the date. */ if (!week_view->multi_week_view) { cairo_save (cr); - gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_GRID]); + gdk_cairo_set_source_color ( + cr, &week_view->colors[E_WEEK_VIEW_COLOR_GRID]); cairo_set_line_width (cr, 0.7); cairo_move_to (cr, x + E_WEEK_VIEW_DATE_LINE_L_PAD, line_y); cairo_line_to (cr, right_edge, line_y); diff --git a/calendar/gui/ea-cal-view.c b/calendar/gui/ea-cal-view.c index bca4710260..2a1c128059 100644 --- a/calendar/gui/ea-cal-view.c +++ b/calendar/gui/ea-cal-view.c @@ -34,9 +34,11 @@ static AtkObject* ea_cal_view_get_parent (AtkObject *accessible); static void ea_cal_view_real_initialize (AtkObject *accessible, gpointer data); static void ea_cal_view_event_changed_cb (ECalendarView *cal_view, - ECalendarViewEvent *event, gpointer data); + ECalendarViewEvent *event, + gpointer data); static void ea_cal_view_event_added_cb (ECalendarView *cal_view, - ECalendarViewEvent *event, gpointer data); + ECalendarViewEvent *event, + gpointer data); static gboolean idle_dates_changed (gpointer data); static void ea_cal_view_dates_change_cb (GnomeCalendar *gcal, gpointer data); diff --git a/calendar/gui/ea-day-view-cell.c b/calendar/gui/ea-day-view-cell.c index 2d42a47fc6..0b0b7a75c5 100644 --- a/calendar/gui/ea-day-view-cell.c +++ b/calendar/gui/ea-day-view-cell.c @@ -283,7 +283,9 @@ ea_day_view_cell_get_parent (AtkObject *accessible) return NULL; cell = E_DAY_VIEW_CELL (g_obj); - return atk_gobject_accessible_for_object (G_OBJECT (cell->day_view->main_canvas_item)); + + return atk_gobject_accessible_for_object ( + G_OBJECT (cell->day_view->main_canvas_item)); } static gint diff --git a/calendar/gui/ea-gnome-calendar.c b/calendar/gui/ea-gnome-calendar.c index 58ecad70fd..ad7d108c25 100644 --- a/calendar/gui/ea-gnome-calendar.c +++ b/calendar/gui/ea-gnome-calendar.c @@ -31,8 +31,6 @@ static void ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass); -static G_CONST_RETURN gchar * ea_gnome_calendar_get_name (AtkObject *accessible); -static G_CONST_RETURN gchar * ea_gnome_calendar_get_description (AtkObject *accessible); static gint ea_gnome_calendar_get_n_children (AtkObject* obj); static AtkObject * ea_gnome_calendar_ref_child (AtkObject *obj, gint i); @@ -40,6 +38,22 @@ static void ea_gcal_dates_change_cb (GnomeCalendar *gcal, gpointer data); static gpointer parent_class = NULL; +static G_CONST_RETURN gchar * +ea_gnome_calendar_get_name (AtkObject *accessible) +{ + if (accessible->name) + return accessible->name; + return _("Gnome Calendar"); +} + +static G_CONST_RETURN gchar * +ea_gnome_calendar_get_description (AtkObject *accessible) +{ + if (accessible->description) + return accessible->description; + return _("Gnome Calendar"); +} + GType ea_gnome_calendar_get_type (void) { @@ -237,22 +251,6 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) return buffer; } -static G_CONST_RETURN gchar * -ea_gnome_calendar_get_name (AtkObject *accessible) -{ - if (accessible->name) - return accessible->name; - return _("Gnome Calendar"); -} - -static G_CONST_RETURN gchar * -ea_gnome_calendar_get_description (AtkObject *accessible) -{ - if (accessible->description) - return accessible->description; - return _("Gnome Calendar"); -} - static gint ea_gnome_calendar_get_n_children (AtkObject* obj) { diff --git a/calendar/gui/ea-jump-button.c b/calendar/gui/ea-jump-button.c index a6775ade55..67c7eebc58 100644 --- a/calendar/gui/ea-jump-button.c +++ b/calendar/gui/ea-jump-button.c @@ -74,7 +74,8 @@ ea_jump_button_get_type (void) /* * Figure out the size of the class and instance - * we are run-time deriving from (atk object for GNOME_TYPE_CANVAS_ITEM, in this case) + * we are run-time deriving from (atk object for + * GNOME_TYPE_CANVAS_ITEM, in this case) */ factory = atk_registry_get_factory (atk_get_default_registry (), diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c index 22ce67ca82..e7749f6a70 100644 --- a/calendar/gui/ea-week-view-main-item.c +++ b/calendar/gui/ea-week-view-main-item.c @@ -805,8 +805,10 @@ table_interface_is_row_selected (AtkTable *table, return FALSE; if ((row < 0)&&(row + 1 > week_view->weeks_shown )) return FALSE; - if (((week_view->selection_start_day < row*7)&&(week_view->selection_end_day<row*7)) - ||((week_view->selection_start_day > row*7+6)&&(week_view->selection_end_day > row*7+6))) + if (((week_view->selection_start_day < row * 7) && + (week_view->selection_end_day < row * 7)) || + ((week_view->selection_start_day > row * 7 + 6) && + (week_view->selection_end_day > row * 7 + 6))) return FALSE; else return TRUE; @@ -817,7 +819,8 @@ table_interface_is_selected (AtkTable *table, gint row, gint column) { - return table_interface_is_row_selected (table, row) && table_interface_is_column_selected(table, column); + return table_interface_is_row_selected (table, row) && + table_interface_is_column_selected (table, column); } static gboolean |