[gnome-calendar] date-chooser: Drop the unused day options callback



commit 91afd1b06dc5c59d2a2d515155f78b31f82d80a5
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Apr 7 09:16:13 2022 +0200

    date-chooser: Drop the unused day options callback
    
    The day options callback is never set, so let's just drop it and all its
    methods.

 src/gui/event-editor/gcal-date-chooser.c | 48 --------------------------------
 src/gui/event-editor/gcal-date-chooser.h | 11 --------
 2 files changed, 59 deletions(-)
---
diff --git a/src/gui/event-editor/gcal-date-chooser.c b/src/gui/event-editor/gcal-date-chooser.c
index 6072953b..c5b8db70 100644
--- a/src/gui/event-editor/gcal-date-chooser.c
+++ b/src/gui/event-editor/gcal-date-chooser.c
@@ -51,10 +51,6 @@ struct _GcalDateChooser
   gboolean            show_day_names;
   gboolean            show_week_numbers;
   gboolean            no_month_change;
-
-  GcalDateChooserDayOptionsCallback day_options_cb;
-  gpointer            day_options_data;
-  GDestroyNotify      day_options_destroy;
 };
 
 G_DEFINE_TYPE (GcalDateChooser, gcal_date_chooser, ADW_TYPE_BIN)
@@ -198,8 +194,6 @@ calendar_compute_days (GcalDateChooser *self)
       gtk_label_set_label (GTK_LABEL (self->rows[row]), text);
       g_free (text);
     }
-
-  gcal_date_chooser_invalidate_day_options (self);
 }
 
 /* 0 == sunday */
@@ -753,45 +747,3 @@ gcal_date_chooser_get_date (GcalDateChooser *self)
 {
   return self->date;
 }
-
-void
-gcal_date_chooser_set_day_options_callback (GcalDateChooser                   *self,
-                                            GcalDateChooserDayOptionsCallback  callback,
-                                            gpointer                           data,
-                                            GDestroyNotify                     destroy)
-{
-  if (self->day_options_destroy)
-    self->day_options_destroy (self->day_options_data);
-
-  self->day_options_cb = callback;
-  self->day_options_data = data;
-  self->day_options_destroy = destroy;
-
-  gcal_date_chooser_invalidate_day_options (self);
-}
-
-
-void
-gcal_date_chooser_invalidate_day_options (GcalDateChooser *self)
-{
-  GcalDateChooserDayOptions options;
-  GcalDateChooserDay *d;
-  GDateTime *date;
-  gint row, col;
-
-  for (row = 0; row < 6; row++)
-    {
-      for (col = 0; col < 7; col++)
-        {
-          d = GCAL_DATE_CHOOSER_DAY (self->days[row][col]);
-          date = gcal_date_chooser_day_get_date (d);
-
-          if (self->day_options_cb)
-            options = self->day_options_cb (self, date, self->day_options_data);
-          else
-            options = GCAL_DATE_CHOOSER_DAY_NONE;
-
-          gcal_date_chooser_day_set_options (d, options);
-        }
-    }
-}
diff --git a/src/gui/event-editor/gcal-date-chooser.h b/src/gui/event-editor/gcal-date-chooser.h
index d04f3e91..5782ebfe 100644
--- a/src/gui/event-editor/gcal-date-chooser.h
+++ b/src/gui/event-editor/gcal-date-chooser.h
@@ -34,10 +34,6 @@ typedef enum
 
 G_DECLARE_FINAL_TYPE (GcalDateChooser, gcal_date_chooser, GCAL, DATE_CHOOSER, AdwBin)
 
-typedef GcalDateChooserDayOptions (*GcalDateChooserDayOptionsCallback) (GcalDateChooser *self,
-                                                                        GDateTime       *date,
-                                                                        gpointer         user_data);
-
 GtkWidget*           gcal_date_chooser_new                       (void);
 
 GDateTime*           gcal_date_chooser_get_date                  (GcalDateChooser    *self);
@@ -45,13 +41,6 @@ GDateTime*           gcal_date_chooser_get_date                  (GcalDateChoose
 void                 gcal_date_chooser_set_date                  (GcalDateChooser    *self,
                                                                   GDateTime          *date);
 
-void                 gcal_date_chooser_set_day_options_callback  (GcalDateChooser    *self,
-                                                                  GcalDateChooserDayOptionsCallback callback,
-                                                                  gpointer            data,
-                                                                  GDestroyNotify      destroy);
-
-void                 gcal_date_chooser_invalidate_day_options    (GcalDateChooser    *self);
-
 gboolean             gcal_date_chooser_get_no_month_change       (GcalDateChooser    *self);
 
 void                 gcal_date_chooser_set_no_month_change       (GcalDateChooser    *self,


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