aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-02 03:21:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-02 03:24:37 +0800
commit8d7a5a1b878015001997a817dda092fd62d54f6e (patch)
treef6311ccc3dca06aeb1e3babd6f5d72db4af90307 /composer/e-msg-composer.c
parent76af649676439392c3e477fd48de49265bc88910 (diff)
downloadgsoc2013-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 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c62
1 files changed, 7 insertions, 55 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index efb29e0b2e..d247180734 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -532,8 +532,6 @@ build_message_headers (EMsgComposer *composer,
{
EComposerHeaderTable *table;
EComposerHeader *header;
- EClientCache *client_cache;
- ESourceRegistry *registry;
ESource *source;
const gchar *subject;
const gchar *reply_to;
@@ -544,11 +542,8 @@ build_message_headers (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);
/* Subject: */
subject = e_composer_header_table_get_subject (table);
@@ -660,9 +655,6 @@ build_message_headers (EMsgComposer *composer,
}
g_list_free (list);
}
-
- g_object_unref (client_cache);
- g_object_unref (registry);
}
static CamelCipherHash
@@ -1086,8 +1078,6 @@ composer_build_message (EMsgComposer *composer,
EComposerHeaderTable *table;
CamelDataWrapper *html;
ESourceMailIdentity *mi;
- EClientCache *client_cache;
- ESourceRegistry *registry;
const gchar *extension_name;
const gchar *iconv_charset = NULL;
const gchar *identity_uid;
@@ -1108,15 +1098,8 @@ composer_build_message (EMsgComposer *composer,
view = e_msg_composer_get_attachment_view (composer);
store = e_attachment_view_get_store (view);
- 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 (&registry);
-
+ source = e_composer_header_table_ref_source (table, identity_uid);
g_return_if_fail (source != NULL);
/* Do all the non-blocking work here, and defer
@@ -1581,8 +1564,6 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
{
EMsgComposerPrivate *p = composer->priv;
EMailSignatureComboBox *combo_box;
- EClientCache *client_cache;
- ESourceRegistry *registry;
ESourceMailComposition *mc;
ESourceOpenPGP *pgp;
ESourceSMIME *smime;
@@ -1603,12 +1584,7 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
if (uid == NULL)
return;
- client_cache = e_composer_header_table_ref_client_cache (table);
- registry = e_client_cache_ref_registry (client_cache);
- source = e_source_registry_ref_source (registry, uid);
- g_clear_object (&client_cache);
- g_clear_object (&registry);
-
+ source = e_composer_header_table_ref_source (table, uid);
g_return_if_fail (source != NULL);
extension_name = E_SOURCE_EXTENSION_MAIL_COMPOSITION;
@@ -3098,8 +3074,6 @@ e_msg_composer_new_with_message (EShell *shell,
EMsgComposer *composer;
EMsgComposerPrivate *priv;
EComposerHeaderTable *table;
- EClientCache *client_cache;
- ESourceRegistry *registry;
ESource *source = NULL;
GtkToggleAction *action;
struct _camel_header_raw *xev;
@@ -3131,9 +3105,6 @@ e_msg_composer_new_with_message (EShell *shell,
postto = NULL;
}
- client_cache = e_composer_header_table_ref_client_cache (table);
- registry = e_client_cache_ref_registry (client_cache);
-
/* Restore the mail identity preference. */
identity_uid = (gchar *) camel_medium_get_header (
CAMEL_MEDIUM (message), "X-Evolution-Identity");
@@ -3144,12 +3115,10 @@ e_msg_composer_new_with_message (EShell *shell,
}
if (identity_uid != NULL) {
identity_uid = g_strstrip (g_strdup (identity_uid));
- source = e_source_registry_ref_source (registry, identity_uid);
+ source = e_composer_header_table_ref_source (
+ table, identity_uid);
}
- g_clear_object (&client_cache);
- g_clear_object (&registry);
-
if (postto == NULL) {
auto_cc = g_hash_table_new_full (
(GHashFunc) camel_strcase_hash,
@@ -4228,8 +4197,6 @@ e_msg_composer_set_body (EMsgComposer *composer,
EMsgComposerPrivate *priv = composer->priv;
EComposerHeaderTable *table;
EWebViewGtkHTML *web_view;
- EClientCache *client_cache;
- ESourceRegistry *registry;
ESource *source;
const gchar *identity_uid;
gchar *buff;
@@ -4238,14 +4205,8 @@ e_msg_composer_set_body (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 (&registry);
+ source = e_composer_header_table_ref_source (table, identity_uid);
buff = g_markup_printf_escaped (
"<b>%s</b>",
@@ -4789,8 +4750,6 @@ e_msg_composer_get_from (EMsgComposer *composer)
CamelInternetAddress *inet_address = NULL;
ESourceMailIdentity *mail_identity;
EComposerHeaderTable *table;
- EClientCache *client_cache;
- ESourceRegistry *registry;
ESource *source;
const gchar *extension_name;
const gchar *uid;
@@ -4801,15 +4760,8 @@ e_msg_composer_get_from (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);
-
- g_clear_object (&client_cache);
- g_clear_object (&registry);
-
+ source = e_composer_header_table_ref_source (table, uid);
g_return_val_if_fail (source != NULL, NULL);
extension_name = E_SOURCE_EXTENSION_MAIL_IDENTITY;