From 25737061ee2b2d5c92f3c3479ea9d812aeae1c0e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 20 Jul 2013 17:37:47 -0400 Subject: Bug 697575 - ESourceConfig: Avoid calling check_complete() too soon Connect to the GtkComboBox::changed signal after all candidates are added, to avoid calling e_source_config_check_complete() before the candidate has been told to insert widgets. This can cause run-time warnings such as: (evolution:7106): evolution-cal-config-webcal-CRITICAL **: cal_config_webcal_check_complete: assertion `context != NULL' failed --- e-util/e-source-config.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'e-util') diff --git a/e-util/e-source-config.c b/e-util/e-source-config.c index 6a4f2ddf93..ba75b7c8bb 100644 --- a/e-util/e-source-config.c +++ b/e-util/e-source-config.c @@ -717,6 +717,17 @@ source_config_realize (GtkWidget *widget) source_config_init_for_adding_source (config); else source_config_init_for_editing_source (config); + + /* Connect this signal AFTER we're done adding candidates + * so we don't trigger check_complete() before candidates + * have a chance to insert widgets. */ + g_signal_connect ( + config->priv->type_combo, "changed", + G_CALLBACK (source_config_type_combo_changed_cb), config); + + /* Trigger the callback to make sure the right page + * is selected, window is an appropriate size, etc. */ + g_signal_emit_by_name (config->priv->type_combo, "changed"); } static GList * @@ -1020,10 +1031,6 @@ e_source_config_init (ESourceConfig *config) gtk_widget_show (widget); pango_attr_list_unref (attr_list); - - g_signal_connect ( - config->priv->type_combo, "changed", - G_CALLBACK (source_config_type_combo_changed_cb), config); } GtkWidget * -- cgit