month-view: optimize set :date property
There's no need to calculate first day of month date twice.
This commit is contained in:
@@ -233,7 +233,6 @@ gcal_month_view_set_property (GObject *object,
|
|||||||
{
|
{
|
||||||
case PROP_DATE:
|
case PROP_DATE:
|
||||||
{
|
{
|
||||||
icaltimetype *first_of_month;
|
|
||||||
time_t range_start, range_end;
|
time_t range_start, range_end;
|
||||||
icaltimetype *date;
|
icaltimetype *date;
|
||||||
icaltimezone* default_zone;
|
icaltimezone* default_zone;
|
||||||
@@ -243,14 +242,11 @@ gcal_month_view_set_property (GObject *object,
|
|||||||
|
|
||||||
priv->date = g_value_dup_boxed (value);
|
priv->date = g_value_dup_boxed (value);
|
||||||
|
|
||||||
first_of_month = gcal_dup_icaltime (priv->date);
|
date = gcal_view_get_initial_date (GCAL_VIEW (object));
|
||||||
first_of_month->day = 1;
|
priv->days_delay = icaltime_day_of_week (*date) - 1;
|
||||||
priv->days_delay = icaltime_day_of_week (*first_of_month) - 1;
|
|
||||||
g_free (first_of_month);
|
|
||||||
|
|
||||||
default_zone =
|
default_zone =
|
||||||
gcal_manager_get_system_timezone (priv->manager);
|
gcal_manager_get_system_timezone (priv->manager);
|
||||||
date = gcal_view_get_initial_date (GCAL_VIEW (object));
|
|
||||||
range_start = icaltime_as_timet_with_zone (*date,
|
range_start = icaltime_as_timet_with_zone (*date,
|
||||||
default_zone);
|
default_zone);
|
||||||
g_free (date);
|
g_free (date);
|
||||||
|
|||||||
Reference in New Issue
Block a user