aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-calendar-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-07-31 00:38:24 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-07-31 10:31:00 +0800
commit2fe24b4c136b4d5f255af3571c3d6e1082071809 (patch)
tree78568dcd907204107ca08afa1cfea84362c345a2 /calendar/gui/e-calendar-view.c
parent41569bb778e228d4f5a04cb1e15bfa5b49bb044b (diff)
downloadgsoc2013-evolution-2fe24b4c136b4d5f255af3571c3d6e1082071809.tar.gz
gsoc2013-evolution-2fe24b4c136b4d5f255af3571c3d6e1082071809.tar.zst
gsoc2013-evolution-2fe24b4c136b4d5f255af3571c3d6e1082071809.zip
Add properties to calendar classes.
So we can bind them to EShellSettings and kill off EDayViewConfig and similar GConf notification classes.
Diffstat (limited to 'calendar/gui/e-calendar-view.c')
-rw-r--r--calendar/gui/e-calendar-view.c67
1 files changed, 42 insertions, 25 deletions
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index a9b717f0eb..543623beaf 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -503,59 +503,72 @@ e_calendar_view_set_default_category (ECalendarView *cal_view, const gchar *cate
GList *
e_calendar_view_get_selected_events (ECalendarView *cal_view)
{
+ ECalendarViewClass *class;
+
g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), NULL);
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_events)
- return E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_events (cal_view);
+ class = E_CALENDAR_VIEW_GET_CLASS (cal_view);
+ g_return_val_if_fail (class->get_selected_events != NULL, NULL);
- return NULL;
+ return class->get_selected_events (cal_view);
}
gboolean
-e_calendar_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time)
+e_calendar_view_get_selected_time_range (ECalendarView *cal_view,
+ time_t *start_time,
+ time_t *end_time)
{
+ ECalendarViewClass *class;
+
g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), FALSE);
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_time_range) {
- return E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_selected_time_range (
- cal_view, start_time, end_time);
- }
+ class = E_CALENDAR_VIEW_GET_CLASS (cal_view);
+ g_return_val_if_fail (class->get_selected_time_range != NULL, FALSE);
- return FALSE;
+ return class->get_selected_time_range (cal_view, start_time, end_time);
}
void
-e_calendar_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time)
+e_calendar_view_set_selected_time_range (ECalendarView *cal_view,
+ time_t start_time,
+ time_t end_time)
{
+ ECalendarViewClass *class;
+
g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->set_selected_time_range) {
- E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->set_selected_time_range (
- cal_view, start_time, end_time);
- }
+ class = E_CALENDAR_VIEW_GET_CLASS (cal_view);
+ g_return_if_fail (class->set_selected_time_range != NULL);
+
+ class->set_selected_time_range (cal_view, start_time, end_time);
}
gboolean
-e_calendar_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time)
+e_calendar_view_get_visible_time_range (ECalendarView *cal_view,
+ time_t *start_time,
+ time_t *end_time)
{
+ ECalendarViewClass *class;
+
g_return_val_if_fail (E_IS_CALENDAR_VIEW (cal_view), FALSE);
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range) {
- return E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range (
- cal_view, start_time, end_time);
- }
+ class = E_CALENDAR_VIEW_GET_CLASS (cal_view);
+ g_return_val_if_fail (class->get_visible_time_range != NULL, FALSE);
- return FALSE;
+ class->get_visible_time_range (cal_view, start_time, end_time);
}
void
e_calendar_view_update_query (ECalendarView *cal_view)
{
+ ECalendarViewClass *class;
+
g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->update_query) {
- E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->update_query (cal_view);
- }
+ class = E_CALENDAR_VIEW_GET_CLASS (cal_view);
+ g_return_if_fail (class->update_query != NULL);
+
+ class->update_query (cal_view);
}
void
@@ -846,10 +859,14 @@ clipboard_get_calendar_data (ECalendarView *cal_view, const gchar *text)
static void
e_calendar_view_paste_text (ECalendarView *cal_view)
{
+ ECalendarViewClass *class;
+
g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
- if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->paste_text)
- E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->paste_text (cal_view);
+ class = E_CALENDAR_VIEW_GET_CLASS (cal_view);
+ g_return_if_fail (class->paste_text != NULL);
+
+ class->paste_text (cal_view);
}
static void