utils: Make date comparison follow time comparison semantics

Right now, comparing dates with gcal_date_time_compare_date() gives
the exact opposite result of when comparing using g_date_time_compare().

As shown by this patch, this was a source of *many* bugs.
This commit is contained in:
Georges Basile Stavracas Neto
2020-04-14 19:08:06 +00:00
parent bed8e10609
commit 12fd607d56
12 changed files with 75 additions and 158 deletions
+6 -22
View File
@@ -48,35 +48,19 @@ gcal_timeline_subscriber_default_init (GcalTimelineSubscriberInterface *iface)
}
/**
* gcal_timeline_subscriber_get_range_start:
* gcal_timeline_subscriber_get_range:
* @self: a #GcalTimelineSubscriber
*
* Retrieves the start of the range of @self.
* Retrieves the range of @self.
*
* Returns: (transfer full): a #GDateTime
* Returns: (transfer full): a #GcalRange
*/
GDateTime*
gcal_timeline_subscriber_get_range_start (GcalTimelineSubscriber *self)
GcalRange*
gcal_timeline_subscriber_get_range (GcalTimelineSubscriber *self)
{
g_return_val_if_fail (GCAL_IS_TIMELINE_SUBSCRIBER (self), NULL);
return GCAL_TIMELINE_SUBSCRIBER_GET_IFACE (self)->get_range_start (self);
}
/**
* gcal_timeline_subscriber_get_range_end:
* @self: a #GcalTimelineSubscriber
*
* Retrieves the end of the range of @self.
*
* Returns: (transfer full): a #GDateTime
*/
GDateTime*
gcal_timeline_subscriber_get_range_end (GcalTimelineSubscriber *self)
{
g_return_val_if_fail (GCAL_IS_TIMELINE_SUBSCRIBER (self), NULL);
return GCAL_TIMELINE_SUBSCRIBER_GET_IFACE (self)->get_range_end (self);
return GCAL_TIMELINE_SUBSCRIBER_GET_IFACE (self)->get_range (self);
}
/**