manager: Remove system timezone support
It is now handled by GcalContext, and no other class uses the manager's system timezone anymore. Next step is to get rid of the e_cal_util_get_system_timezone() calls, but that will require the GcalTimeline API.
This commit is contained in:
+5
-25
@@ -90,9 +90,6 @@ struct _GcalManager
|
|||||||
|
|
||||||
/* state flags */
|
/* state flags */
|
||||||
gint sources_at_launch;
|
gint sources_at_launch;
|
||||||
|
|
||||||
/* timezone */
|
|
||||||
icaltimezone *system_timezone;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (GcalManager, gcal_manager, G_TYPE_OBJECT)
|
G_DEFINE_TYPE (GcalManager, gcal_manager, G_TYPE_OBJECT)
|
||||||
@@ -898,7 +895,6 @@ gcal_manager_class_init (GcalManagerClass *klass)
|
|||||||
static void
|
static void
|
||||||
gcal_manager_init (GcalManager *self)
|
gcal_manager_init (GcalManager *self)
|
||||||
{
|
{
|
||||||
self->system_timezone = e_cal_util_get_system_timezone ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Public API */
|
/* Public API */
|
||||||
@@ -1015,22 +1011,6 @@ gcal_manager_set_default_source (GcalManager *self,
|
|||||||
e_source_registry_set_default_calendar (self->source_registry, source);
|
e_source_registry_set_default_calendar (self->source_registry, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gcal_manager_get_system_timezone:
|
|
||||||
* @self: a #GcalManager
|
|
||||||
*
|
|
||||||
* Retireves the default timezone.
|
|
||||||
*
|
|
||||||
* Returns: (transfer none): the default timezone
|
|
||||||
*/
|
|
||||||
icaltimezone*
|
|
||||||
gcal_manager_get_system_timezone (GcalManager *self)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (GCAL_IS_MANAGER (self), NULL);
|
|
||||||
|
|
||||||
return self->system_timezone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gcal_manager_setup_shell_search:
|
* gcal_manager_setup_shell_search:
|
||||||
* @self: a #GcalManager
|
* @self: a #GcalManager
|
||||||
@@ -1054,7 +1034,7 @@ gcal_manager_setup_shell_search (GcalManager *self,
|
|||||||
self);
|
self);
|
||||||
|
|
||||||
e_cal_data_model_set_expand_recurrences (self->shell_search_data_model, TRUE);
|
e_cal_data_model_set_expand_recurrences (self->shell_search_data_model, TRUE);
|
||||||
e_cal_data_model_set_timezone (self->shell_search_data_model, self->system_timezone);
|
e_cal_data_model_set_timezone (self->shell_search_data_model, e_cal_util_get_system_timezone ());
|
||||||
|
|
||||||
self->search_view_data = g_new0 (ViewStateData, 1);
|
self->search_view_data = g_new0 (ViewStateData, 1);
|
||||||
self->search_view_data->subscriber = subscriber;
|
self->search_view_data->subscriber = subscriber;
|
||||||
@@ -1742,8 +1722,8 @@ gcal_manager_get_events (GcalManager *self,
|
|||||||
|
|
||||||
g_return_val_if_fail (GCAL_IS_MANAGER (self), NULL);
|
g_return_val_if_fail (GCAL_IS_MANAGER (self), NULL);
|
||||||
|
|
||||||
range_start = icaltime_as_timet_with_zone (*start_date, self->system_timezone);
|
range_start = icaltime_as_timet_with_zone (*start_date, e_cal_util_get_system_timezone ());
|
||||||
range_end = icaltime_as_timet_with_zone (*end_date, self->system_timezone);
|
range_end = icaltime_as_timet_with_zone (*end_date, e_cal_util_get_system_timezone ());
|
||||||
|
|
||||||
e_cal_data_model_foreach_component (self->e_data_model,
|
e_cal_data_model_foreach_component (self->e_data_model,
|
||||||
range_start,
|
range_start,
|
||||||
@@ -1926,9 +1906,9 @@ gcal_manager_startup (GcalManager *self)
|
|||||||
self->search_data_model = e_cal_data_model_new (submit_thread_job);
|
self->search_data_model = e_cal_data_model_new (submit_thread_job);
|
||||||
|
|
||||||
e_cal_data_model_set_expand_recurrences (self->e_data_model, TRUE);
|
e_cal_data_model_set_expand_recurrences (self->e_data_model, TRUE);
|
||||||
e_cal_data_model_set_timezone (self->e_data_model, self->system_timezone);
|
e_cal_data_model_set_timezone (self->e_data_model, e_cal_util_get_system_timezone ());
|
||||||
e_cal_data_model_set_expand_recurrences (self->search_data_model, TRUE);
|
e_cal_data_model_set_expand_recurrences (self->search_data_model, TRUE);
|
||||||
e_cal_data_model_set_timezone (self->search_data_model, self->system_timezone);
|
e_cal_data_model_set_timezone (self->search_data_model, e_cal_util_get_system_timezone ());
|
||||||
|
|
||||||
sources = e_source_registry_list_enabled (self->source_registry, E_SOURCE_EXTENSION_CALENDAR);
|
sources = e_source_registry_list_enabled (self->source_registry, E_SOURCE_EXTENSION_CALENDAR);
|
||||||
self->sources_at_launch = g_list_length (sources);
|
self->sources_at_launch = g_list_length (sources);
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ ESource* gcal_manager_get_default_source (GcalManager
|
|||||||
void gcal_manager_set_default_source (GcalManager *self,
|
void gcal_manager_set_default_source (GcalManager *self,
|
||||||
ESource *source);
|
ESource *source);
|
||||||
|
|
||||||
icaltimezone* gcal_manager_get_system_timezone (GcalManager *self);
|
|
||||||
|
|
||||||
void gcal_manager_set_subscriber (GcalManager *self,
|
void gcal_manager_set_subscriber (GcalManager *self,
|
||||||
ECalDataModelSubscriber *subscriber,
|
ECalDataModelSubscriber *subscriber,
|
||||||
time_t range_start,
|
time_t range_start,
|
||||||
|
|||||||
Reference in New Issue
Block a user