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.
This commit is contained in:
Erick Pérez Castellanos
2015-01-20 13:12:00 -05:00
parent ffc7a7f577
commit c62d808a35
+2 -1
View File
@@ -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)