From c62d808a35f9d9b8f51ed8b8e6f7a3d1d17e6b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Tue, 20 Jan 2015 00:34:22 -0500 Subject: [PATCH] year-view: fix subscriber callback GcalYearView::start_selected_date will always be started into something and comparing against zero no matters what returns will enter in one of the two categories Still before 3.16, this code should change. --- src/gcal-year-view.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c index e04d9a8a..59bc7bb1 100644 --- a/src/gcal-year-view.c +++ b/src/gcal-year-view.c @@ -1057,7 +1057,7 @@ gcal_year_view_component_changed (ECalDataModelSubscriber *subscriber, GcalYearViewPrivate *priv = GCAL_YEAR_VIEW (subscriber)->priv; ECalComponentDateTime dtstart, dtend; - if (priv->update_sidebar_needed || priv->start_selected_date->day == 0) + if (priv->update_sidebar_needed) return; e_cal_component_get_dtstart (comp, &dtstart); @@ -1066,6 +1066,7 @@ gcal_year_view_component_changed (ECalDataModelSubscriber *subscriber, /* FIXME: this implementation clear the sidebar are rebuild it * it should only add, what's new, and add it sorted in its position */ /* XXX: implement using shift as data and GtkListBox sort_func */ + /* XXX: comparing against zero is not reliable, but it can only result in TRUE */ if (icaltime_compare_date_only (*(dtstart.value), *(priv->start_selected_date)) >= 0) priv->update_sidebar_needed = TRUE; else if (icaltime_compare_date_only (*(dtend.value), *(priv->end_selected_date)) <= 0)