diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-06-02 03:21:53 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-06-02 03:24:37 +0800 |
commit | 8d7a5a1b878015001997a817dda092fd62d54f6e (patch) | |
tree | f6311ccc3dca06aeb1e3babd6f5d72db4af90307 /mail | |
parent | 76af649676439392c3e477fd48de49265bc88910 (diff) | |
download | gsoc2013-evolution-8d7a5a1b878015001997a817dda092fd62d54f6e.tar gsoc2013-evolution-8d7a5a1b878015001997a817dda092fd62d54f6e.tar.gz gsoc2013-evolution-8d7a5a1b878015001997a817dda092fd62d54f6e.tar.bz2 gsoc2013-evolution-8d7a5a1b878015001997a817dda092fd62d54f6e.tar.lz gsoc2013-evolution-8d7a5a1b878015001997a817dda092fd62d54f6e.tar.xz gsoc2013-evolution-8d7a5a1b878015001997a817dda092fd62d54f6e.tar.zst gsoc2013-evolution-8d7a5a1b878015001997a817dda092fd62d54f6e.zip |
Add e_composer_header_table_ref_source().
Convenience function that works like e_source_registry_ref_source(),
but spares the caller from digging out the ESourceRegistry from the
header table.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-composer-utils.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 0927d6fa90..21961ef573 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -374,13 +374,13 @@ composer_presend_check_identity (EMsgComposer *composer, table = e_msg_composer_get_header_table (composer); - client_cache = e_composer_header_table_ref_client_cache (table); - registry = e_client_cache_ref_registry (client_cache); - uid = e_composer_header_table_get_identity_uid (table); - source = e_source_registry_ref_source (registry, uid); + source = e_composer_header_table_ref_source (table, uid); g_return_val_if_fail (source != NULL, FALSE); + client_cache = e_composer_header_table_ref_client_cache (table); + registry = e_client_cache_ref_registry (client_cache); + if (!e_source_registry_check_enabled (registry, source)) { e_alert_submit ( E_ALERT_SINK (composer), @@ -843,8 +843,6 @@ em_utils_composer_save_to_drafts_cb (EMsgComposer *composer, { AsyncContext *context; EComposerHeaderTable *table; - EClientCache *client_cache; - ESourceRegistry *registry; ESource *source; const gchar *local_drafts_folder_uri; const gchar *identity_uid; @@ -858,14 +856,8 @@ em_utils_composer_save_to_drafts_cb (EMsgComposer *composer, table = e_msg_composer_get_header_table (composer); - client_cache = e_composer_header_table_ref_client_cache (table); - registry = e_client_cache_ref_registry (client_cache); - identity_uid = e_composer_header_table_get_identity_uid (table); - source = e_source_registry_ref_source (registry, identity_uid); - - g_clear_object (&client_cache); - g_clear_object (®istry); + source = e_composer_header_table_ref_source (table, identity_uid); /* Get the selected identity's preferred Drafts folder. */ if (source != NULL) { |