[gnome-calendar] view iface: remove more unused methods



commit f988eac12f3460d3920b1341d08ae7f9b1da853b
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Tue Oct 21 01:36:14 2014 -0400

    view iface: remove more unused methods
    
    GcalView::draw_event overlapped a bit with GcalView::will_add_event, so
    the same reasons for removing one stand for the other.
    GcalView::clear was a hack for the composited GcalDayView which has
    gone, and was a bad experiment.

 src/gcal-month-view.c |   32 --------------------------------
 src/gcal-view.c       |   41 -----------------------------------------
 src/gcal-view.h       |    8 --------
 src/gcal-week-view.c  |    4 ++--
 src/gcal-year-view.c  |   31 -------------------------------
 5 files changed, 2 insertions(+), 114 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index b83c644..0fb4168 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -127,15 +127,9 @@ static gchar*         gcal_month_view_get_left_header       (GcalView       *vie
 
 static gchar*         gcal_month_view_get_right_header      (GcalView       *view);
 
-static gboolean       gcal_month_view_draw_event            (GcalView       *view,
-                                                             icaltimetype   *start_date,
-                                                             icaltimetype   *end_date);
-
 static GtkWidget*     gcal_month_view_get_by_uuid           (GcalView       *view,
                                                              const gchar    *uuid);
 
-static void           gcal_month_view_clear                 (GcalView       *view);
-
 G_DEFINE_TYPE_WITH_CODE (GcalMonthView,
                          gcal_month_view,
                          GCAL_TYPE_SUBSCRIBER,
@@ -222,9 +216,7 @@ gcal_view_interface_init (GcalViewIface *iface)
   iface->get_left_header = gcal_month_view_get_left_header;
   iface->get_right_header = gcal_month_view_get_right_header;
 
-  iface->draw_event = gcal_month_view_draw_event;
   iface->get_by_uuid = gcal_month_view_get_by_uuid;
-  iface->clear = gcal_month_view_clear;
 }
 
 static void
@@ -1282,23 +1274,6 @@ gcal_month_view_get_right_header (GcalView *view)
   return g_strdup_printf ("%d", priv->date->year);
 }
 
-static gboolean
-gcal_month_view_draw_event (GcalView     *view,
-                            icaltimetype *start_date,
-                            icaltimetype *end_date)
-{
-  GcalMonthViewPrivate *priv;
-
-  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;
-
-  return (priv->date->month == start_date->month &&
-          priv->date->year == start_date->year);
-}
-
 static GtkWidget*
 gcal_month_view_get_by_uuid (GcalView    *view,
                              const gchar *uuid)
@@ -1326,13 +1301,6 @@ gcal_month_view_get_by_uuid (GcalView    *view,
   return NULL;
 }
 
-static void
-gcal_month_view_clear (GcalView *view)
-{
-  gtk_container_foreach (GTK_CONTAINER (view),
-                         (GtkCallback) gtk_widget_destroy, NULL);
-}
-
 /* Public API */
 /**
  * gcal_month_view_new:
diff --git a/src/gcal-view.c b/src/gcal-view.c
index 2d070a8..8439067 100644
--- a/src/gcal-view.c
+++ b/src/gcal-view.c
@@ -228,29 +228,6 @@ gcal_view_get_right_header (GcalView *view)
 }
 
 /**
- * gcal_view_draw_event:
- * @view: a #GcalView
- * @start_date: an #icaltimetype object. The starting date of the event
- * @end_date: an #icaltimetype object. The edn-date of the event
- *
- * Whether the event within these boundaries will be drawn by the #GcalView implementation
- *
- * Returns: %TRUE if it is, %FALSE otherwise
- **/
-gboolean
-gcal_view_draw_event (GcalView     *view,
-                      icaltimetype *start_date,
-                      icaltimetype *end_date)
-{
-  g_return_val_if_fail (GCAL_IS_VIEW (view), FALSE);
-  g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->draw_event);
-
-  return GCAL_VIEW_GET_INTERFACE (view)->draw_event (view,
-                                                     start_date,
-                                                     end_date);
-}
-
-/**
  * gcal_view_get_by_uuid:
  * @view: a #GcalView
  * @uuid: the uuid of the event-widget
@@ -270,21 +247,3 @@ gcal_view_get_by_uuid (GcalView    *view,
 
   return GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid (view, uuid);
 }
-
-/**
- * gcal_view_clear:
- * @view: a #GcalView object
- *
- * Destroy every children inside the view.
- *
- * Note: this is a hack because of not-working container code
- * for day and week view composited widgets.
- **/
-void
-gcal_view_clear (GcalView *view)
-{
-  g_return_if_fail (GCAL_IS_VIEW (view));
-  g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->clear);
-
-  GCAL_VIEW_GET_INTERFACE (view)->clear (view);
-}
diff --git a/src/gcal-view.h b/src/gcal-view.h
index 4936f5e..85db9eb 100644
--- a/src/gcal-view.h
+++ b/src/gcal-view.h
@@ -61,9 +61,7 @@ struct _GcalViewIface
   gchar*          (*get_right_header)                   (GcalView     *view);
 
   /* Container functions related API */
-  gboolean        (*draw_event)                         (GcalView *view, icaltimetype *start_date, 
icaltimetype *end_date);
   GtkWidget*      (*get_by_uuid)                        (GcalView *view, const gchar *uuid);
-  void            (*clear)                              (GcalView *view);
 };
 
 GType         gcal_view_get_type                      (void);
@@ -88,15 +86,9 @@ gchar*        gcal_view_get_left_header               (GcalView     *view);
 
 gchar*        gcal_view_get_right_header              (GcalView     *view);
 
-gboolean      gcal_view_draw_event                    (GcalView     *view,
-                                                       icaltimetype *start_date,
-                                                       icaltimetype *end_date);
-
 GtkWidget*    gcal_view_get_by_uuid                   (GcalView     *view,
                                                        const gchar  *uuid);
 
-void          gcal_view_clear                         (GcalView     *view);
-
 G_END_DECLS
 
 #endif /* __GCAL_MONTH_VIEW_H__ */
diff --git a/src/gcal-week-view.c b/src/gcal-week-view.c
index 0f35d39..6a9b3d1 100644
--- a/src/gcal-week-view.c
+++ b/src/gcal-week-view.c
@@ -230,9 +230,7 @@ gcal_view_interface_init (GcalViewIface *iface)
   iface->get_left_header = gcal_week_view_get_left_header;
   iface->get_right_header = gcal_week_view_get_right_header;
 
-  iface->draw_event = gcal_week_view_draw_event;
   iface->get_by_uuid = gcal_week_view_get_by_uuid;
-  /* iface->clear = gcal_week_view_clear; */
 }
 
 static void
@@ -917,6 +915,7 @@ gcal_week_view_set_date (GcalWeekView *view,
   priv = gcal_week_view_get_instance_private (view);
   will_resize = FALSE;
 
+  /* FIXME: draw_event don't exist anymore */
   /* if span_updated: queue_resize */
   will_resize = ! gcal_week_view_draw_event (GCAL_VIEW (view), date, NULL);
 
@@ -1362,6 +1361,7 @@ gcal_week_view_get_right_header (GcalView *view)
   return header;
 }
 
+/* FIXME: replace cause it doesn't exist anymore */
 static gboolean
 gcal_week_view_draw_event (GcalView     *view,
                            icaltimetype *start_date,
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index 2926683..08d57a9 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -122,15 +122,9 @@ static gchar*         gcal_year_view_get_left_header              (GcalView
 
 static gchar*         gcal_year_view_get_right_header             (GcalView       *view);
 
-static gboolean       gcal_year_view_draw_event                   (GcalView       *view,
-                                                                   icaltimetype   *start_date,
-                                                                   icaltimetype   *end_date);
-
 static GtkWidget*     gcal_year_view_get_by_uuid                  (GcalView       *view,
                                                                    const gchar    *uuid);
 
-static void           gcal_year_view_clear                        (GcalView       *view);
-
 G_DEFINE_TYPE_WITH_CODE (GcalYearView,
                          gcal_year_view,
                          GCAL_TYPE_SUBSCRIBER,
@@ -209,9 +203,7 @@ gcal_view_interface_init (GcalViewIface *iface)
   iface->get_left_header = gcal_year_view_get_left_header;
   iface->get_right_header = gcal_year_view_get_right_header;
 
-  iface->draw_event = gcal_year_view_draw_event;
   iface->get_by_uuid = gcal_year_view_get_by_uuid;
-  iface->clear = gcal_year_view_clear;
 }
 
 static void
@@ -1000,22 +992,6 @@ gcal_year_view_get_right_header (GcalView *view)
   return g_strdup ("");
 }
 
-static gboolean
-gcal_year_view_draw_event (GcalView     *view,
-                           icaltimetype *start_date,
-                           icaltimetype *end_date)
-{
-  GcalYearViewPrivate *priv;
-
-  g_return_val_if_fail (GCAL_IS_YEAR_VIEW (view), FALSE);
-  priv = gcal_year_view_get_instance_private (GCAL_YEAR_VIEW (view));
-
-  if (priv->date == NULL)
-    return FALSE;
-
-  return priv->date->year == start_date->year;
-}
-
 static GtkWidget*
 gcal_year_view_get_by_uuid (GcalView    *view,
                             const gchar *uuid)
@@ -1043,13 +1019,6 @@ gcal_year_view_get_by_uuid (GcalView    *view,
   return NULL;
 }
 
-static void
-gcal_year_view_clear (GcalView *view)
-{
-  gtk_container_foreach (GTK_CONTAINER (view),
-                         (GtkCallback) gtk_widget_destroy, NULL);
-}
-
 /* Public API */
 /**
  * gcal_year_view_new:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]