diff options
author | Milan Crha <mcrha@redhat.com> | 2011-08-16 14:52:13 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-08-16 14:52:13 +0800 |
commit | 082f62aaa3958d8748bf1033efa8d90d439049aa (patch) | |
tree | 77d7e6eec7ab7e87905df1989eb73bb0aaa47a25 /mail/em-config.c | |
parent | 6e1e36c0474312058a1479d2f570428c2dc0e806 (diff) | |
download | gsoc2013-evolution-082f62aaa3958d8748bf1033efa8d90d439049aa.tar.gz gsoc2013-evolution-082f62aaa3958d8748bf1033efa8d90d439049aa.tar.zst gsoc2013-evolution-082f62aaa3958d8748bf1033efa8d90d439049aa.zip |
Bug #656620 - Account editor doesn't update on settings change
Diffstat (limited to 'mail/em-config.c')
-rw-r--r-- | mail/em-config.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mail/em-config.c b/mail/em-config.c index fbde5d5430..3f649bacb3 100644 --- a/mail/em-config.c +++ b/mail/em-config.c @@ -85,6 +85,8 @@ em_config_set_target (EConfig *ep, config->priv->account_changed_id = g_signal_connect ( s->modified_account, "changed", G_CALLBACK (emp_account_changed), ep); + + em_config_target_new_account_update_settings (ep, s, s->settings); break; } } } @@ -110,6 +112,8 @@ em_config_target_free (EConfig *ep, config->priv->account_changed_id); config->priv->account_changed_id = 0; } + + em_config_target_new_account_update_settings (ep, s, NULL); break; } } } @@ -233,3 +237,37 @@ em_config_target_new_account (EMConfig *emp, return t; } + +void +em_config_target_new_account_update_settings (EConfig *ep, EMConfigTargetAccount *target, CamelSettings *settings) +{ + g_return_if_fail (ep != NULL); + g_return_if_fail (target != NULL); + + if (settings) + g_object_ref (settings); + + if (target->settings != NULL) { + g_signal_handlers_disconnect_by_func (target->settings, G_CALLBACK (emp_account_changed), ep); + g_object_unref (target->settings); + } + + target->settings = settings; + + if (target->settings != NULL) { + GParamSpec **params; + guint n_params = 0; + + params = camel_settings_class_list_settings (CAMEL_SETTINGS_GET_CLASS (target->settings), &n_params); + if (params) { + guint ii; + gchar *sig_name; + + for (ii = 0; ii < n_params; ii++) { + sig_name = g_strconcat ("notify::", params[ii]->name, NULL); + g_signal_connect (target->settings, sig_name, G_CALLBACK (emp_account_changed), ep); + g_free (sig_name); + } + } + } +} |