From a33dbd139ebe3a07b42aeea5dac0e5b206335e76 Mon Sep 17 00:00:00 2001 From: Bob Ham Date: Mon, 8 Oct 2018 10:46:00 +0000 Subject: [PATCH] main-window: Set up Provider in constructed callback --- src/calls-main-window.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/calls-main-window.c b/src/calls-main-window.c index f614713..d320f0d 100644 --- a/src/calls-main-window.c +++ b/src/calls-main-window.c @@ -228,19 +228,6 @@ add_provider_origins (CallsMainWindow *self, CallsProvider *provider) } -static void -set_provider (CallsMainWindow *self, CallsProvider *provider) -{ - g_signal_connect_swapped (provider, "message", - G_CALLBACK (show_message), self); - g_signal_connect_swapped (provider, "origin-added", - G_CALLBACK (add_origin), self); - - g_set_object (&self->provider, provider); - - add_provider_origins (self, provider); -} - static void set_property (GObject *object, guint property_id, @@ -251,7 +238,7 @@ set_property (GObject *object, switch (property_id) { case PROP_PROVIDER: - set_provider (self, CALLS_PROVIDER (g_value_get_object (value))); + g_set_object (&self->provider, CALLS_PROVIDER (g_value_get_object (value))); break; default: @@ -269,6 +256,14 @@ constructed (GObject *object) GSimpleActionGroup *simple_action_group; CallsNewCallBox *new_call_box; + /* Set up provider */ + g_signal_connect_swapped (self->provider, "message", + G_CALLBACK (show_message), self); + g_signal_connect_swapped (self->provider, "origin-added", + G_CALLBACK (add_origin), self); + + add_provider_origins (self, self->provider); + /* Add new call box */ new_call_box = calls_new_call_box_new (self->provider); gtk_stack_add_titled (self->main_stack, GTK_WIDGET (new_call_box),