application: Delay context initialization

This commit is contained in:
Georges Basile Stavracas Neto
2019-04-25 16:30:58 -03:00
parent 09cb142a5b
commit da3a903d1e
3 changed files with 42 additions and 3 deletions
+11 -2
View File
@@ -245,8 +245,6 @@ gcal_context_init (GcalContext *self)
self->settings = g_settings_new ("org.gnome.calendar");
self->weather_service = gcal_weather_service_new ();
self->night_light_monitor = gcal_night_light_monitor_new (self);
self->timezone_monitor = gcal_time_zone_monitor_new ();
g_signal_connect_object (self->timezone_monitor,
"notify::timezone",
@@ -382,3 +380,14 @@ gcal_context_get_weather_service (GcalContext *self)
return self->weather_service;
}
void
gcal_context_startup (GcalContext *self)
{
g_return_if_fail (GCAL_IS_CONTEXT (self));
/* Night Light requires GTK to be initialized */
self->night_light_monitor = gcal_night_light_monitor_new (self);
gcal_manager_startup (self->manager);
}