[gnome-calendar] event-widget: add ::compare_by_start_date



commit 420e66bdb1bb9d3c413caa136d0f990c9911b0ca
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Fri Dec 19 22:08:34 2014 -0500

    event-widget: add ::compare_by_start_date
    
    This function will eventually deprecate gcal_compare_event_widget_by_date()

 src/gcal-event-widget.c |   13 +++++++++++++
 src/gcal-event-widget.h |    3 +++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c
index f3a8a38..432b91e 100644
--- a/src/gcal-event-widget.c
+++ b/src/gcal-event-widget.c
@@ -1160,3 +1160,16 @@ gcal_event_widget_compare_by_length (GcalEventWidget *widget1,
 
   return (time_e2 - time_s2) - (time_e1 - time_s1);
 }
+
+gint
+gcal_event_widget_compare_by_start_date (GcalEventWidget *widget1,
+                                         GcalEventWidget *widget2)
+{
+  GcalEventWidgetPrivate *priv1;
+  GcalEventWidgetPrivate *priv2;
+
+  priv1 = gcal_event_widget_get_instance_private (widget1);
+  priv2 = gcal_event_widget_get_instance_private (widget2);
+
+  return icaltime_compare (*(priv1->dt_start), *(priv2->dt_start));
+}
diff --git a/src/gcal-event-widget.h b/src/gcal-event-widget.h
index cb8b23c..6ed2084 100644
--- a/src/gcal-event-widget.h
+++ b/src/gcal-event-widget.h
@@ -114,6 +114,9 @@ gboolean     gcal_event_widget_equal                       (GcalEventWidget    *
 gint         gcal_event_widget_compare_by_length           (GcalEventWidget    *widget1,
                                                             GcalEventWidget    *widget2);
 
+gint         gcal_event_widget_compare_by_start_date       (GcalEventWidget    *widget1,
+                                                            GcalEventWidget    *widget2);
+
 G_END_DECLS
 
 #endif /* __GCAL_EVENT_WIDGET_H__ */


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