From d0d4166d2326ab963177454d22d2076e482a20e5 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Thu, 19 Sep 2019 15:37:45 -0500 Subject: [PATCH] context: initialize GcalSearchEngine later After the next commit, GcalSearchEngine will require GcalContext to be ready to initialize itself. --- src/core/gcal-context.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/gcal-context.c b/src/core/gcal-context.c index cd8b441e..ea2e8fb2 100644 --- a/src/core/gcal-context.c +++ b/src/core/gcal-context.c @@ -102,6 +102,16 @@ on_timezone_changed_cb (GcalTimeZoneMonitor *timezone_monitor, * GObject overrides */ +static void +gcal_context_constructed (GObject *object) +{ + GcalContext *self = (GcalContext *)object; + + G_OBJECT_CLASS (gcal_context_parent_class)->constructed (object); + + self->search_engine = gcal_search_engine_new (self); +} + static void gcal_context_finalize (GObject *object) { @@ -193,6 +203,7 @@ gcal_context_class_init (GcalContextClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + object_class->constructed = gcal_context_constructed; object_class->finalize = gcal_context_finalize; object_class->get_property = gcal_context_get_property; object_class->set_property = gcal_context_set_property; @@ -257,7 +268,6 @@ gcal_context_init (GcalContext *self) self->manager = gcal_manager_new (); self->settings = g_settings_new ("org.gnome.calendar"); self->weather_service = gcal_weather_service_new (); - self->search_engine = gcal_search_engine_new (self); self->timezone_monitor = gcal_time_zone_monitor_new (); g_signal_connect_object (self->timezone_monitor,