view: cleanup unused code
This commit is contained in:
@@ -95,40 +95,6 @@ gcal_view_get_date (GcalView *view)
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* gcal_view_get_initial_date:
|
||||
* @view: a #GcalView
|
||||
*
|
||||
* Return the initial date represented by the view.
|
||||
*
|
||||
* Returns: (transfer full): An #icaltimetype object
|
||||
**/
|
||||
icaltimetype*
|
||||
gcal_view_get_initial_date (GcalView *view)
|
||||
{
|
||||
g_return_val_if_fail (GCAL_IS_VIEW (view), NULL);
|
||||
g_return_val_if_fail (GCAL_VIEW_GET_IFACE (view)->get_initial_date, NULL);
|
||||
|
||||
return GCAL_VIEW_GET_IFACE (view)->get_initial_date (view);
|
||||
}
|
||||
|
||||
/**
|
||||
* gcal_view_get_final_date:
|
||||
* @view: a #GcalView
|
||||
*
|
||||
* Return the final date represented by the view.
|
||||
*
|
||||
* Returns: (transfer full): An #icaltimetype object
|
||||
**/
|
||||
icaltimetype*
|
||||
gcal_view_get_final_date (GcalView *view)
|
||||
{
|
||||
g_return_val_if_fail (GCAL_IS_VIEW (view), NULL);
|
||||
g_return_val_if_fail (GCAL_VIEW_GET_IFACE (view)->get_final_date, NULL);
|
||||
|
||||
return GCAL_VIEW_GET_IFACE (view)->get_final_date (view);
|
||||
}
|
||||
|
||||
/**
|
||||
* gcal_view_clear_marks:
|
||||
* @view: a #GcalView
|
||||
|
||||
@@ -42,10 +42,6 @@ struct _GcalViewInterface
|
||||
icaltimetype *start_span,
|
||||
icaltimetype *end_span);
|
||||
|
||||
/* Time handling related API */
|
||||
icaltimetype* (*get_initial_date) (GcalView *view);
|
||||
icaltimetype* (*get_final_date) (GcalView *view);
|
||||
|
||||
/* Marks related API */
|
||||
void (*clear_marks) (GcalView *view);
|
||||
|
||||
@@ -58,10 +54,6 @@ void gcal_view_set_date (GcalView *view,
|
||||
|
||||
icaltimetype* gcal_view_get_date (GcalView *view);
|
||||
|
||||
icaltimetype* gcal_view_get_initial_date (GcalView *view);
|
||||
|
||||
icaltimetype* gcal_view_get_final_date (GcalView *view);
|
||||
|
||||
void gcal_view_clear_marks (GcalView *view);
|
||||
|
||||
GList* gcal_view_get_children_by_uuid (GcalView *view,
|
||||
|
||||
@@ -914,55 +914,6 @@ add_new_event_button_cb (GtkWidget *button,
|
||||
}
|
||||
|
||||
/* GcalView Interface API */
|
||||
static icaltimetype*
|
||||
gcal_month_view_get_initial_date (GcalView *view)
|
||||
{
|
||||
//FIXME to retrieve the 35 days range
|
||||
GcalMonthView *self;
|
||||
icaltimetype *new_date;
|
||||
|
||||
g_return_val_if_fail (GCAL_IS_MONTH_VIEW (view), NULL);
|
||||
|
||||
self = GCAL_MONTH_VIEW (view);
|
||||
|
||||
new_date = gcal_dup_icaltime (self->date);
|
||||
new_date->day = 1;
|
||||
new_date->is_date = 0;
|
||||
new_date->hour = 0;
|
||||
new_date->minute = 0;
|
||||
new_date->second = 0;
|
||||
|
||||
return new_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* gcal_month_view_get_final_date:
|
||||
*
|
||||
* Since: 0.1
|
||||
* Return value: the last day of the month
|
||||
* Returns: (transfer full): Release with g_free()
|
||||
**/
|
||||
static icaltimetype*
|
||||
gcal_month_view_get_final_date (GcalView *view)
|
||||
{
|
||||
//FIXME to retrieve the 35 days range
|
||||
GcalMonthView *self;
|
||||
icaltimetype *new_date;
|
||||
|
||||
g_return_val_if_fail (GCAL_IS_MONTH_VIEW (view), NULL);
|
||||
|
||||
self = GCAL_MONTH_VIEW (view);
|
||||
|
||||
new_date = gcal_dup_icaltime (self->date);
|
||||
new_date->day = icaltime_days_in_month (self->date->month, self->date->year);
|
||||
new_date->is_date = 0;
|
||||
new_date->hour = 23;
|
||||
new_date->minute = 59;
|
||||
new_date->second = 59;
|
||||
|
||||
return new_date;
|
||||
}
|
||||
|
||||
static void
|
||||
gcal_month_view_clear_marks (GcalView *view)
|
||||
{
|
||||
@@ -988,11 +939,7 @@ gcal_month_view_get_children_by_uuid (GcalView *view,
|
||||
static void
|
||||
gcal_view_interface_init (GcalViewInterface *iface)
|
||||
{
|
||||
iface->get_initial_date = gcal_month_view_get_initial_date;
|
||||
iface->get_final_date = gcal_month_view_get_final_date;
|
||||
|
||||
iface->clear_marks = gcal_month_view_clear_marks;
|
||||
|
||||
iface->get_children_by_uuid = gcal_month_view_get_children_by_uuid;
|
||||
}
|
||||
|
||||
|
||||
@@ -162,60 +162,6 @@ schedule_position_scroll (GcalWeekView *self)
|
||||
self);
|
||||
}
|
||||
|
||||
/**
|
||||
* gcal_week_view_get_initial_date:
|
||||
*
|
||||
* Since: 0.1
|
||||
* Return value: the first day of the week
|
||||
* Returns: (transfer full): Release with g_free()
|
||||
**/
|
||||
static icaltimetype*
|
||||
gcal_week_view_get_initial_date (GcalView *view)
|
||||
{
|
||||
GcalWeekView *self;
|
||||
icaltimetype *new_date;
|
||||
|
||||
g_return_val_if_fail (GCAL_IS_WEEK_VIEW (view), NULL);
|
||||
self = GCAL_WEEK_VIEW(view);
|
||||
new_date = g_new0 (icaltimetype, 1);
|
||||
*new_date = icaltime_from_day_of_year (icaltime_start_doy_week (*(self->date),
|
||||
self->first_weekday + 1),
|
||||
self->date->year);
|
||||
new_date->is_date = 0;
|
||||
new_date->hour = 0;
|
||||
new_date->minute = 0;
|
||||
new_date->second = 0;
|
||||
*new_date = icaltime_set_timezone (new_date, self->date->zone);
|
||||
return new_date;
|
||||
}
|
||||
|
||||
/**
|
||||
* gcal_week_view_get_final_date:
|
||||
*
|
||||
* Since: 0.1
|
||||
* Return value: the last day of the week
|
||||
* Returns: (transfer full): Release with g_free()
|
||||
**/
|
||||
static icaltimetype*
|
||||
gcal_week_view_get_final_date (GcalView *view)
|
||||
{
|
||||
GcalWeekView *self;
|
||||
icaltimetype *new_date;
|
||||
|
||||
g_return_val_if_fail (GCAL_IS_WEEK_VIEW (view), NULL);
|
||||
self = GCAL_WEEK_VIEW(view);
|
||||
new_date = g_new0 (icaltimetype, 1);
|
||||
*new_date = icaltime_from_day_of_year (icaltime_start_doy_week (*(self->date),
|
||||
self->first_weekday + 1) + 6,
|
||||
self->date->year);
|
||||
new_date->is_date = 0;
|
||||
new_date->hour = 23;
|
||||
new_date->minute = 59;
|
||||
new_date->second = 0;
|
||||
*new_date = icaltime_set_timezone (new_date, self->date->zone);
|
||||
return new_date;
|
||||
}
|
||||
|
||||
static GList*
|
||||
gcal_week_view_get_children_by_uuid (GcalView *view,
|
||||
const gchar *uuid)
|
||||
@@ -486,8 +432,6 @@ gcal_week_view_draw_hours (GcalWeekView *self,
|
||||
static void
|
||||
gcal_view_interface_init (GcalViewInterface *iface)
|
||||
{
|
||||
iface->get_initial_date = gcal_week_view_get_initial_date;
|
||||
iface->get_final_date = gcal_week_view_get_final_date;
|
||||
iface->get_children_by_uuid = gcal_week_view_get_children_by_uuid;
|
||||
iface->clear_marks = gcal_week_view_clear_marks;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user