From 0dc9aae35b1032c04f1de5a8eb2aff77550d7897 Mon Sep 17 00:00:00 2001
From: Matthew Barnes <mbarnes@redhat.com>
Date: Sat, 1 Jun 2013 14:25:11 -0400
Subject: EComposeHeaderTable: Replace "registry" property with "client-cache".

The ESourceRegistry can still be obtained from the EClientCache:

   client_cache = e_composer_header_table_ref_client_cache (table);
   registry = e_client_cache_ref_registry (client_cache);

   ...

   g_object_unref (client_cache);
   g_object_unref (registry);

Added functions:

  e_composer_header_table_ref_client_cache()

Removed functions:

  e_composer_header_table_get_registry()
---
 mail/em-composer-utils.c | 34 +++++++++++++++++++++++++++++-----
 1 file changed, 29 insertions(+), 5 deletions(-)

(limited to 'mail/em-composer-utils.c')

diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index a8815f6f54..0927d6fa90 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -366,13 +366,17 @@ composer_presend_check_identity (EMsgComposer *composer,
                                  EMailSession *session)
 {
 	EComposerHeaderTable *table;
+	EClientCache *client_cache;
 	ESourceRegistry *registry;
 	ESource *source;
 	const gchar *uid;
 	gboolean success = TRUE;
 
 	table = e_msg_composer_get_header_table (composer);
-	registry = e_composer_header_table_get_registry (table);
+
+	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_return_val_if_fail (source != NULL, FALSE);
@@ -384,6 +388,8 @@ composer_presend_check_identity (EMsgComposer *composer,
 		success = FALSE;
 	}
 
+	g_object_unref (client_cache);
+	g_object_unref (registry);
 	g_object_unref (source);
 
 	return success;
@@ -837,6 +843,7 @@ 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;
@@ -851,10 +858,15 @@ em_utils_composer_save_to_drafts_cb (EMsgComposer *composer,
 
 	table = e_msg_composer_get_header_table (composer);
 
-	registry = e_composer_header_table_get_registry (table);
+	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);
+
 	/* Get the selected identity's preferred Drafts folder. */
 	if (source != NULL) {
 		ESourceMailComposition *extension;
@@ -999,6 +1011,7 @@ create_new_composer (EShell *shell,
                      CamelFolder *folder)
 {
 	EMsgComposer *composer;
+	EClientCache *client_cache;
 	ESourceRegistry *registry;
 	EComposerHeaderTable *table;
 	ESource *source = NULL;
@@ -1007,7 +1020,9 @@ create_new_composer (EShell *shell,
 	composer = e_msg_composer_new (shell);
 
 	table = e_msg_composer_get_header_table (composer);
-	registry = e_composer_header_table_get_registry (table);
+
+	client_cache = e_composer_header_table_ref_client_cache (table);
+	registry = e_client_cache_ref_registry (client_cache);
 
 	if (folder != NULL) {
 		CamelStore *store;
@@ -1036,6 +1051,9 @@ create_new_composer (EShell *shell,
 
 	g_free (identity);
 
+	g_object_unref (client_cache);
+	g_object_unref (registry);
+
 	return composer;
 }
 
@@ -1080,8 +1098,9 @@ em_utils_compose_new_message_with_mailto (EShell *shell,
                                           CamelFolder *folder)
 {
 	EMsgComposer *composer;
-	ESourceRegistry *registry;
 	EComposerHeaderTable *table;
+	EClientCache *client_cache;
+	ESourceRegistry *registry;
 
 	g_return_val_if_fail (E_IS_SHELL (shell), NULL);
 
@@ -1094,7 +1113,9 @@ em_utils_compose_new_message_with_mailto (EShell *shell,
 		composer = e_msg_composer_new (shell);
 
 	table = e_msg_composer_get_header_table (composer);
-	registry = e_composer_header_table_get_registry (table);
+
+	client_cache = e_composer_header_table_ref_client_cache (table);
+	registry = e_client_cache_ref_registry (client_cache);
 
 	composer_set_no_change (composer);
 
@@ -1117,6 +1138,9 @@ em_utils_compose_new_message_with_mailto (EShell *shell,
 		}
 	}
 
+	g_object_unref (client_cache);
+	g_object_unref (registry);
+
 	return composer;
 }
 
-- 
cgit