[gnome-calendar] view iface: remove unused will_add_event
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] view iface: remove unused will_add_event
- Date: Thu, 4 Dec 2014 22:39:15 +0000 (UTC)
commit 6f2b01018f9dcd6c268ac50af39ea49f57bac055
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Tue Oct 21 00:45:04 2014 -0400
view iface: remove unused will_add_event
ECalDataModelSubscriber interface notify each view only about the events
beloging to the subscribed range so there's no need of checking if the
event widget will be added.
The safety check of not adding the same widget twice its stil being made
on each GtkContainer::add implementation.
src/gcal-month-view.c | 34 ----------------------------------
src/gcal-view.c | 22 ----------------------
src/gcal-view.h | 6 ------
src/gcal-week-view.c | 12 ------------
src/gcal-year-view.c | 13 -------------
5 files changed, 0 insertions(+), 87 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 00dda35..f731e95 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -136,9 +136,6 @@ static GtkWidget* gcal_month_view_get_by_uuid (GcalView *vie
static void gcal_month_view_clear (GcalView *view);
-static gboolean gcal_month_view_will_add_event (GcalView *view,
- GcalEventWidget *event);
-
G_DEFINE_TYPE_WITH_CODE (GcalMonthView,
gcal_month_view,
GCAL_TYPE_SUBSCRIBER,
@@ -228,8 +225,6 @@ gcal_view_interface_init (GcalViewIface *iface)
iface->draw_event = gcal_month_view_draw_event;
iface->get_by_uuid = gcal_month_view_get_by_uuid;
iface->clear = gcal_month_view_clear;
-
- iface->will_add_event = gcal_month_view_will_add_event;
}
static void
@@ -1338,35 +1333,6 @@ gcal_month_view_clear (GcalView *view)
(GtkCallback) gtk_widget_destroy, NULL);
}
-static gboolean
-gcal_month_view_will_add_event (GcalView *view,
- GcalEventWidget *event)
-{
- GcalMonthViewPrivate *priv;
-
- icaltimetype *start_date;
- gboolean is_in_range;
-
- const gchar* event_uuid;
-
- g_return_val_if_fail (GCAL_IS_MONTH_VIEW (view), FALSE);
- priv = gcal_month_view_get_instance_private (GCAL_MONTH_VIEW (view));
-
- if (priv->date == NULL)
- return FALSE;
-
- start_date = gcal_event_widget_get_date (event);
- is_in_range = (priv->date->month == start_date->month &&
- priv->date->year == start_date->year);
- g_free (start_date);
-
- if (!is_in_range)
- return FALSE;
-
- event_uuid = gcal_event_widget_peek_uuid (event);
- return !(gcal_month_view_get_by_uuid (view, event_uuid) != NULL);
-}
-
/* Public API */
/**
* gcal_month_view_new:
diff --git a/src/gcal-view.c b/src/gcal-view.c
index 4331a87..09b431f 100644
--- a/src/gcal-view.c
+++ b/src/gcal-view.c
@@ -307,25 +307,3 @@ gcal_view_clear (GcalView *view)
GCAL_VIEW_GET_INTERFACE (view)->clear (view);
}
-
-/**
- * gcal_view_will_add_event:
- * @view: a #GcalView
- * @event: a #GcalEventWidget
- *
- * Check the ranges of dates and the existence of the widget in
- * in the view already
- *
- * Returns: %TRUE if the date of the widget fall inside the range and
- * the widget isn't already on the view, %FALSE otherwise
- **/
-gboolean
-gcal_view_will_add_event (GcalView *view,
- GcalEventWidget *event)
-{
- g_return_val_if_fail (GCAL_IS_VIEW (view), FALSE);
- g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->will_add_event);
-
- return GCAL_VIEW_GET_INTERFACE (view)->will_add_event (view,
- event);
-}
diff --git a/src/gcal-view.h b/src/gcal-view.h
index 56bb6b0..f9558d1 100644
--- a/src/gcal-view.h
+++ b/src/gcal-view.h
@@ -71,9 +71,6 @@ struct _GcalViewIface
gboolean (*draw_event) (GcalView *view, icaltimetype *start_date,
icaltimetype *end_date);
GtkWidget* (*get_by_uuid) (GcalView *view, const gchar *uuid);
void (*clear) (GcalView *view);
-
- /* Newer API */
- gboolean (*will_add_event) (GcalView *view, GcalEventWidget *event);
};
GType gcal_view_get_type (void);
@@ -114,9 +111,6 @@ GtkWidget* gcal_view_get_by_uuid (GcalView *view,
void gcal_view_clear (GcalView *view);
-gboolean gcal_view_will_add_event (GcalView *view,
- GcalEventWidget *event);
-
G_END_DECLS
#endif /* __GCAL_MONTH_VIEW_H__ */
diff --git a/src/gcal-week-view.c b/src/gcal-week-view.c
index a6f2ace..0f35d39 100644
--- a/src/gcal-week-view.c
+++ b/src/gcal-week-view.c
@@ -156,9 +156,6 @@ static gboolean gcal_week_view_draw_event (GcalView *view
static GtkWidget* gcal_week_view_get_by_uuid (GcalView *view,
const gchar *uuid);
-static gboolean gcal_week_view_will_add_event (GcalView *view,
- GcalEventWidget *event);
-
G_DEFINE_TYPE_WITH_CODE (GcalWeekView,
gcal_week_view,
GTK_TYPE_CONTAINER,
@@ -236,8 +233,6 @@ gcal_view_interface_init (GcalViewIface *iface)
iface->draw_event = gcal_week_view_draw_event;
iface->get_by_uuid = gcal_week_view_get_by_uuid;
/* iface->clear = gcal_week_view_clear; */
-
- iface->will_add_event = gcal_week_view_will_add_event;
}
static void
@@ -1418,13 +1413,6 @@ gcal_week_view_get_by_uuid (GcalView *view,
return NULL;
}
-static gboolean
-gcal_week_view_will_add_event (GcalView *view,
- GcalEventWidget *event)
-{
- ;
-}
-
/* Public API */
/**
* gcal_week_view_new:
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index 7acc044..2926683 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -131,9 +131,6 @@ static GtkWidget* gcal_year_view_get_by_uuid (GcalView
static void gcal_year_view_clear (GcalView *view);
-static gboolean gcal_year_view_will_add_event (GcalView *view,
- GcalEventWidget *event);
-
G_DEFINE_TYPE_WITH_CODE (GcalYearView,
gcal_year_view,
GCAL_TYPE_SUBSCRIBER,
@@ -215,8 +212,6 @@ gcal_view_interface_init (GcalViewIface *iface)
iface->draw_event = gcal_year_view_draw_event;
iface->get_by_uuid = gcal_year_view_get_by_uuid;
iface->clear = gcal_year_view_clear;
-
- iface->will_add_event = gcal_year_view_will_add_event;
}
static void
@@ -1055,14 +1050,6 @@ gcal_year_view_clear (GcalView *view)
(GtkCallback) gtk_widget_destroy, NULL);
}
-static gboolean
-gcal_year_view_will_add_event (GcalView *view,
- GcalEventWidget *event)
-{
- /* FIXME: implement me !!! */
- return FALSE;
-}
-
/* Public API */
/**
* gcal_year_view_new:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]