Re: [evolution-patches] gconf unref fixes



patch attached

On Thu, 2003-06-05 at 19:43, Not Zed wrote:
> looks ok.
> 
> should we just be using some mail_get_gconf() call instead (that returns
> a static reference at that?).
> 
> e.g. what if we ever wanted to not get the 'default' gconf?
> 
> On Fri, 2003-06-06 at 06:04, Jeffrey Stedfast wrote:
> > don't leak refs to gconf-client
> 
> _______________________________________________
> Evolution-patches mailing list
> Evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com
? 43862.patch
? 43972-mailer.patch
? crash.txt
? empty-subject.patch
? global-gconf.patch
? mail-local.patch
? message-tree.c
? message-tree.h
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2744
diff -u -r1.2744 ChangeLog
--- ChangeLog	3 Jun 2003 20:46:31 -0000	1.2744
+++ ChangeLog	6 Jun 2003 17:41:06 -0000
@@ -1,3 +1,86 @@
+2003-06-06  Jeffrey Stedfast  <fejj ximian com>
+
+	* message-tag-followup.c (get_week_start_day): Use mail-config's
+	gconf client.
+	(target_date_new): Same.
+
+	* message-list.c (message_list_set_folder): Use mail-config's
+	gconf client.
+	(mail_regen_list): Same.
+
+	* mail-tools.c (mail_tool_quote_message): Use mail-config's gconf
+	client.
+	(mail_tool_forward_message): Same.
+
+	* mail-session.c (main_get_filter_driver): Use mail-config's gconf
+	client.
+
+	* mail-preferences.c (mail_preferences_init): Use mail-config's
+	gconf client.
+	(mail_preferences_finalise): Don't unref the gconf client.
+
+	* mail-format.c (write_headers): Use mail-config's gconf client.
+	(mail_format_data_wrapper_write_to_stream): Same.
+	(handle_text_plain): And here.
+
+	* mail-display.c (save_data_cb): Use mail-config's gconf client.
+	(save_part): Same.
+	(on_url_requested): Here too.
+	(mail_text_write): And here.
+	(mail_display_init): And here.
+	(mail_display_destroy): Here too.
+	(mail_display_new): Again here.
+
+	* mail-composer-prefs.c (sig_add_cb): Use mail-config's gconf
+	client.
+	(mail_composer_prefs_construct): Same.
+
+	* mail-callbacks.c (ask_confirm_for_unwanted_html_mail): Use
+	mail-config's gconf client.
+	(ask_confirm_for_empty_subject): Same.
+	(ask_confirm_for_only_bcc): Here too.
+	(composer_get_message): And here.
+	(create_msg_composer): Again here.
+	(mail_generate_reply): Same.
+	(forward): And here.
+	(transfer_msg_done): "
+	(delete_msg): "
+	(confirm_expunge): "
+
+	* component-factory.c (owner_unset_cb): Use mail-config's gconf
+	client.
+
+	* folder-browser-ui.c (folder_browser_ui_add_message): Use the
+	mailer's gconf client.
+	(folder_browser_ui_add_list): Same.
+	(folder_browser_ui_add_global): Here too.
+
+	* folder-browser.c (save_cursor_pos): Use the mailer's gconf
+	client.
+	(folder_browser_set_message_preview): Same.
+	(folder_browser_toggle_preview): Here too.
+	(folder_browser_toggle_threads): And here.
+	(folder_browser_toggle_hide_deleted): Here as well.
+	(folder_browser_set_message_display_style): And here.
+	(fb_resize_cb): Here.
+	(paned_realised): And here.
+	(done_message_selected): And everywhere...
+
+	* mail-account-gui.c (sig_add_new_signature): Use the mailer gconf
+	client.
+
+	* mail-config.c (mail_config_get_gconf_client): New function to
+	return the global GConfClient used by the mailer.
+	(mail_config_write_on_exit): On exit, free our objects and such.
+	(mail_config_signature_run_script): Use config->gconf.
+
+2003-06-04  Jeffrey Stedfast  <fejj ximian com>
+
+	* mail-callbacks.c (invert_selection): Get rid of the if-focused
+	code, that will always prevent the etree from getting the
+	selection inverted because the menu item will always have focus at
+	this time. Fix for bug #43972.
+
 2003-06-03  Federico Mena Quintero  <federico ximian com>
 
 	* mail-search.c (mail_search_construct): Put the buttons in HIG
Index: component-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/component-factory.c,v
retrieving revision 1.326
diff -u -r1.326 component-factory.c
--- component-factory.c	20 May 2003 14:53:59 -0000	1.326
+++ component-factory.c	6 Jun 2003 17:41:07 -0000
@@ -912,12 +912,13 @@
 static void
 owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data)
 {
-	GConfClient *gconf;
 	CORBA_Environment ev;
+	GConfClient *gconf;
 	int i;
 	EIterator *it;
-
-	gconf = gconf_client_get_default ();
+	
+	gconf = mail_config_get_gconf_client ();
+	
 	for (i=0;i<sizeof(shell_component_handlers)/sizeof(shell_component_handlers[0]);i++)
 		g_signal_handler_disconnect((GtkObject *)shell_component, shell_component_handlers[i].hand);
 	
Index: folder-browser-ui.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/folder-browser-ui.c,v
retrieving revision 1.79
diff -u -r1.79 folder-browser-ui.c
--- folder-browser-ui.c	13 May 2003 16:12:10 -0000	1.79
+++ folder-browser-ui.c	6 Jun 2003 17:41:07 -0000
@@ -44,6 +44,7 @@
 
 #include "e-util/e-meta.h"
 
+#include "mail-config.h"
 #include "mail-callbacks.h" /* almost all the verbs */
 #include "mail-session.h" /* mail_session_forget_passwords */
 
@@ -517,6 +518,8 @@
 	GConfClient *gconf;
 	int style;
 	
+	gconf = mail_config_get_gconf_client ();
+	
 	if (fb->sensitise_state) {
 		g_hash_table_destroy(fb->sensitise_state);
 		fb->sensitise_state = NULL;
@@ -524,8 +527,6 @@
 	
 	ui_add (fb, "message", message_verbs, message_pixcache);
 	
-	gconf = gconf_client_get_default ();
-	
 	/* Display Style */
 	style = gconf_client_get_int (gconf, "/apps/evolution/mail/display/message_style", NULL);
 	style = style >= 0 && style < MAIL_CONFIG_DISPLAY_MAX ? style : 0;
@@ -559,7 +560,7 @@
 	GConfClient *gconf;
 	int state;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	if (fb->sensitise_state) {
 		g_hash_table_destroy (fb->sensitise_state);
@@ -613,14 +614,14 @@
 	GConfClient *gconf;
 	int paned_size;
 	
+	gconf = mail_config_get_gconf_client ();
+	
 	if (fb->sensitise_state) {
 		g_hash_table_destroy (fb->sensitise_state);
 		fb->sensitise_state = NULL;
 	}
 	
 	ui_add (fb, "global", global_verbs, global_pixcache);
-	
-	gconf = gconf_client_get_default ();
 	
 	/* (Pre)view pane size (do this first because it affects the
            preview settings - see folder_browser_set_message_preview()
Index: folder-browser.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/folder-browser.c,v
retrieving revision 1.344
diff -u -r1.344 folder-browser.c
--- folder-browser.c	14 May 2003 18:47:10 -0000	1.344
+++ folder-browser.c	6 Jun 2003 17:41:09 -0000
@@ -160,12 +160,9 @@
 {
 	FolderBrowser *folder_browser;
 	CORBA_Environment ev;
-	GConfClient *gconf;
 	
 	folder_browser = FOLDER_BROWSER (object);
-	
-	gconf = gconf_client_get_default ();
-	
+		
 	CORBA_exception_init (&ev);
 	
 	if (folder_browser->seen_id != 0) {
@@ -1121,7 +1118,7 @@
 	e_tree_get_cell_geometry (fb->message_list->tree, row, 0,
 				  NULL, &y, NULL, &height);
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	paned_size = gconf_client_get_int (gconf, "/apps/evolution/mail/display/paned_size", NULL);
 	
 	adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (fb->message_list));
@@ -1156,9 +1153,9 @@
 	
 	folder_browser->preview_shown = show_preview;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	paned_size = gconf_client_get_int (gconf, "/apps/evolution/mail/display/paned_size", NULL);
-	
+
 	if (show_preview) {
 		y = save_cursor_pos (folder_browser);
 		gtk_paned_set_position (GTK_PANED (folder_browser->vpaned), paned_size);
@@ -1300,13 +1297,17 @@
 {
 	FolderBrowser *fb = user_data;
 	gboolean bstate;
+	GConfClient *gconf;
 
 	if (type != Bonobo_UIComponent_STATE_CHANGED || fb->message_list == NULL)
 		return;
 	
 	bstate = atoi(state);
 	e_meta_set_bool(fb->meta, "show_preview", bstate);
-	gconf_client_set_bool (gconf_client_get_default(), "/apps/evolution/mail/display/show_preview", bstate, NULL);
+	
+	gconf = mail_config_get_gconf_client ();
+	gconf_client_set_bool (gconf, "/apps/evolution/mail/display/show_preview", bstate, NULL);
+	
 	folder_browser_set_message_preview (fb, bstate);
 }
 
@@ -1320,13 +1321,17 @@
 	FolderBrowser *fb = user_data;
 	int prev_state;
 	gboolean bstate;
+	GConfClient *gconf;
 	
 	if (type != Bonobo_UIComponent_STATE_CHANGED || fb->message_list == NULL)
 		return;
 
 	bstate = atoi(state);
 	e_meta_set_bool(fb->meta, "thread_list", bstate);
-	gconf_client_set_bool (gconf_client_get_default (), "/apps/evolution/mail/display/thread_list", bstate, NULL);
+	
+	gconf = mail_config_get_gconf_client ();
+	gconf_client_set_bool (gconf, "/apps/evolution/mail/display/thread_list", bstate, NULL);
+	
 	message_list_set_threaded (fb->message_list, bstate);
 	
 	prev_state = fb->selection_state;
@@ -1347,7 +1352,7 @@
 	if (type != Bonobo_UIComponent_STATE_CHANGED || fb->message_list == NULL)
 		return;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	gconf_client_set_bool (gconf, "/apps/evolution/mail/display/show_deleted",
 			       !atoi (state), NULL);
 	
@@ -1372,9 +1377,7 @@
 	    || fb->message_list == NULL)
 		return;
 	
-	gconf = gconf_client_get_default ();
-	
-	printf ("message display style: %s\n", path);
+	gconf = mail_config_get_gconf_client ();
 	
 	for (i = 0; i < MAIL_CONFIG_DISPLAY_MAX; i++) {
 		if (strstr (message_display_styles[i], path)) {
@@ -1383,6 +1386,7 @@
 			
 			if (fb->pref_master)
 				gconf_client_set_int (gconf, "/apps/evolution/mail/display/message_style", i, NULL);
+			
 			return;
 		}
 	}
@@ -2313,12 +2317,12 @@
 fb_resize_cb (GtkWidget *w, GdkEventButton *e, FolderBrowser *fb)
 {
 	GConfClient *gconf;
-
-	gconf = gconf_client_get_default ();
-
-	if (GTK_WIDGET_REALIZED (w) && fb->preview_shown)
+	
+	if (GTK_WIDGET_REALIZED (w) && fb->preview_shown) {
+		gconf = mail_config_get_gconf_client ();
 		gconf_client_set_int (gconf, "/apps/evolution/mail/display/paned_size", gtk_paned_get_position (GTK_PANED (w)), NULL);
-
+	}
+	
 	return FALSE;
 }
 
@@ -2326,9 +2330,11 @@
 static void
 paned_realised(GtkWidget *w, FolderBrowser *fb)
 {
+	GConfClient *gconf;
 	int size;
-
-	size = gconf_client_get_int (gconf_client_get_default (), "/apps/evolution/mail/display/paned_size", NULL);
+	
+	gconf = mail_config_get_gconf_client ();
+	size = gconf_client_get_int (gconf, "/apps/evolution/mail/display/paned_size", NULL);
 	gtk_paned_set_position (GTK_PANED (fb->vpaned), size);
 }
 
@@ -2415,12 +2421,10 @@
 	GConfClient *gconf;
 	int timeout;
 	
-	gconf = gconf_client_get_default ();
-	
 	if (folder != fb->folder || fb->mail_display == NULL)
 		return;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	timeout = gconf_client_get_int (gconf, "/apps/evolution/mail/display/mark_seen_timeout", NULL);
 	
 	info = camel_folder_get_message_info (fb->folder, uid);
Index: mail-account-gui.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-account-gui.c,v
retrieving revision 1.131
diff -u -r1.131 mail-account-gui.c
--- mail-account-gui.c	20 May 2003 15:53:45 -0000	1.131
+++ mail-account-gui.c	6 Jun 2003 17:41:09 -0000
@@ -42,6 +42,7 @@
 #include "mail-send-recv.h"
 #include "mail-signature-editor.h"
 #include "mail-composer-prefs.h"
+#include "mail-config.h"
 #include "mail-ops.h"
 #include "mail-mt.h"
 #include "mail.h"
@@ -1297,7 +1298,7 @@
 	
 	sig_switch_to_list (w, gui);
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
 	
 	parent = gtk_widget_get_toplevel (w);
Index: mail-callbacks.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-callbacks.c,v
retrieving revision 1.444
diff -u -r1.444 mail-callbacks.c
--- mail-callbacks.c	21 May 2003 15:27:53 -0000	1.444
+++ mail-callbacks.c	6 Jun 2003 17:41:11 -0000
@@ -246,7 +246,7 @@
 	GString *str;
 	int i;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	if (!gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/unwanted_html", NULL))
 		return TRUE;
@@ -279,7 +279,7 @@
 	gboolean show_again, res;
 	GConfClient *gconf;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	if (!gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/empty_subject", NULL))
 		return TRUE;
@@ -299,7 +299,7 @@
 	const char *first_text;
 	GConfClient *gconf;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	if (!gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/only_bcc", NULL))
 		return TRUE;
@@ -414,7 +414,7 @@
 	EAccount *account;
 	int i;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	/* We should do all of the validity checks based on the composer, and not on
 	   the created message, as extra interaction may occur when we get the message
@@ -763,7 +763,7 @@
 	if (account == NULL)
 		account = mail_config_get_default_account ();
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
 	
 	if (post)
@@ -996,7 +996,7 @@
 	time_t date;
 	char *url;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	if (mode == REPLY_POST) {
 		composer = e_msg_composer_new_post ();
@@ -1499,7 +1499,7 @@
 	MailConfigForwardStyle style;
 	GConfClient *gconf;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	style = gconf_client_get_int (gconf, "/apps/evolution/mail/format/forward_style", NULL);
 	
 	if (style == MAIL_CONFIG_FORWARD_ATTACHED)
@@ -1660,7 +1660,7 @@
 	int row;
 	
 	if (ok && !FOLDER_BROWSER_IS_DESTROYED (fb)) {
-		gconf = gconf_client_get_default ();
+		gconf = mail_config_get_gconf_client ();
 		hide_deleted = !gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_deleted", NULL);
 		
 		row = e_tree_row_of_node (fb->message_list->tree,
@@ -1960,11 +1960,9 @@
 	if (FOLDER_BROWSER_IS_DESTROYED (fb))
 		return;
 	
-	if (GTK_WIDGET_HAS_FOCUS (fb->message_list)) {
-		etsm = e_tree_get_selection_model (fb->message_list->tree);
-		
-		e_selection_model_invert_selection (etsm);
-	}
+	etsm = e_tree_get_selection_model (fb->message_list->tree);
+	
+	e_selection_model_invert_selection (etsm);
 }
 
 /* flag all selected messages. Return number flagged */
@@ -2545,8 +2543,6 @@
 	if (FOLDER_BROWSER_IS_DESTROYED (fb))
 		return;
 	
-	gconf = gconf_client_get_default ();
-	
 	deleted = flag_messages (fb, CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN,
 				 CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_SEEN);
 	
@@ -2555,6 +2551,7 @@
 		row = e_tree_row_of_node (fb->message_list->tree,
 					  e_tree_get_cursor (fb->message_list->tree));
 		
+		gconf = mail_config_get_gconf_client ();
 		hide_deleted = !gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_deleted", NULL);
 		
 		/* If this is the last message and deleted messages
@@ -2679,7 +2676,7 @@
 	gboolean res, show_again;
 	GConfClient *gconf;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	if (!gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/expunge", NULL))
 		return TRUE;
Index: mail-composer-prefs.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-composer-prefs.c,v
retrieving revision 1.63
diff -u -r1.63 mail-composer-prefs.c
--- mail-composer-prefs.c	20 May 2003 18:33:32 -0000	1.63
+++ mail-composer-prefs.c	6 Jun 2003 17:41:12 -0000
@@ -281,7 +281,7 @@
 	gboolean send_html;
 	GtkWidget *parent;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
 	
 	parent = gtk_widget_get_toplevel ((GtkWidget *) prefs);
@@ -796,7 +796,7 @@
 	int style;
 	char *buf;
 	
-	prefs->gconf = gconf_client_get_default ();
+	prefs->gconf = mail_config_get_gconf_client ();
 	
 	gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "composer_tab", NULL);
 	prefs->gui = gui;
Index: mail-config.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config.c,v
retrieving revision 1.279
diff -u -r1.279 mail-config.c
--- mail-config.c	30 May 2003 18:27:03 -0000	1.279
+++ mail-config.c	6 Jun 2003 17:41:12 -0000
@@ -38,9 +38,6 @@
 #include <gtkhtml/gtkhtml.h>
 #include <glade/glade.h>
 
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
 #include <libxml/tree.h>
 #include <libxml/parser.h>
 
@@ -653,9 +650,20 @@
 	
 	/* now do cleanup */
 	mail_config_clear ();
+	
+	g_object_unref (config->gconf);
+	g_ptr_array_free (config->mime_types, TRUE);
+	
+	g_free (config);
 }
 
 /* Accessor functions */
+GConfClient *
+mail_config_get_gconf_client (void)
+{
+	return config->gconf;
+}
+
 gboolean
 mail_config_is_configured (void)
 {
@@ -1560,7 +1568,6 @@
 		CamelStreamMem *memstream;
 		CamelMimeFilter *charenc;
 		CamelStream *stream;
-		GConfClient *gconf;
 		GByteArray *buffer;
 		char *charset;
 		char *content;
@@ -1568,8 +1575,6 @@
 		/* parent process */
 		close (in_fds[1]);
 		
-		gconf = gconf_client_get_default ();
-		
 		stream = camel_stream_fs_new_with_fd (in_fds[0]);
 		
 		memstream = (CamelStreamMem *) camel_stream_mem_new ();
@@ -1591,7 +1596,7 @@
 			filtered_stream = camel_stream_filter_new_with_stream (stream);
 			camel_object_unref (stream);
 			
-			charset = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL);
+			charset = gconf_client_get_string (config->gconf, "/apps/evolution/mail/composer/charset", NULL);
 			charenc = (CamelMimeFilter *) camel_mime_filter_charset_new_convert (charset, "utf-8");
 			camel_stream_filter_add (filtered_stream, charenc);
 			camel_object_unref (charenc);
Index: mail-config.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config.h,v
retrieving revision 1.111
diff -u -r1.111 mail-config.h
--- mail-config.h	29 Apr 2003 18:18:36 -0000	1.111
+++ mail-config.h	6 Jun 2003 17:41:12 -0000
@@ -24,6 +24,10 @@
 #define MAIL_CONFIG_H
 
 #include <gtk/gtk.h>
+
+#include <gconf/gconf.h>
+#include <gconf/gconf-client.h>
+
 #include <camel/camel.h>
 
 #include "e-util/e-account.h"
@@ -99,6 +103,8 @@
 void mail_config_clear (void);
 void mail_config_write (void);
 void mail_config_write_on_exit (void);
+
+GConfClient *mail_config_get_gconf_client (void);
 
 /* General Accessor functions */
 gboolean mail_config_is_configured            (void);
Index: mail-display.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-display.c,v
retrieving revision 1.281
diff -u -r1.281 mail-display.c
--- mail-display.c	21 May 2003 15:27:54 -0000	1.281
+++ mail-display.c	6 Jun 2003 17:41:13 -0000
@@ -255,7 +255,7 @@
 	
 	/* preserve the pathname */
 	dir = g_path_get_dirname (gtk_file_selection_get_filename (file_select));
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	gconf_client_set_string (gconf, "/apps/evolution/mail/save_dir", dir, NULL);
 	g_free (dir);
 	
@@ -328,7 +328,7 @@
 	camel_object_ref (part);
 	
 	home = getenv ("HOME");
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	dir = gconf_client_get_string (gconf, "/apps/evolution/mail/save_dir", NULL);
 	filename = make_safe_filename (dir ? dir : (home ? home : ""), part);
 	g_free (dir);
@@ -1248,7 +1248,7 @@
 	CamelMedium *medium;
 	GByteArray *ba;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	urls = g_datalist_get_data (md->data, "part_urls");
 	g_return_if_fail (urls != NULL);
@@ -1720,7 +1720,7 @@
 	GdkColor colour;
 	char *buf;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES;
 	
@@ -2059,7 +2059,7 @@
 	g_object_ref (mail_display->invisible);
 	gtk_object_sink ((GtkObject *) mail_display->invisible);
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	style = gconf_client_get_int (gconf, "/apps/evolution/mail/format/message_display_style", NULL);
 	mail_display->display_style     = style;
 	
@@ -2113,10 +2113,9 @@
 	}
 	
 	if (mail_display->priv && mail_display->priv->display_notify_id) {
-		GConfClient *gconf = gconf_client_get_default ();
+		GConfClient *gconf = mail_config_get_gconf_client ();
 		gconf_client_notify_remove (gconf, mail_display->priv->display_notify_id);
 		mail_display->priv->display_notify_id = 0;
-		g_object_unref (gconf);
 	}
 	
 	g_free (mail_display->priv);
@@ -2710,14 +2709,13 @@
 		gtk_selection_add_target (mail_display->invisible,
 					  clipboard_atom, GDK_SELECTION_TYPE_STRING, 1);
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	gtk_html_set_animate (GTK_HTML (html), gconf_client_get_bool (gconf, "/apps/evolution/mail/display/animate_images", NULL));
-
+	
 	gconf_client_add_dir (gconf, "/apps/evolution/mail/display",GCONF_CLIENT_PRELOAD_NONE, NULL);
 	mail_display->priv->display_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/display",
 									 display_notify, mail_display, NULL, NULL);
-	g_object_unref (gconf);
-
+	
 	mail_display->scroll = GTK_SCROLLED_WINDOW (scroll);
 	mail_display->html = GTK_HTML (html);
 	g_object_ref (mail_display->html);
Index: mail-format.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-format.c,v
retrieving revision 1.284
diff -u -r1.284 mail-format.c
--- mail-format.c	29 Apr 2003 17:00:08 -0000	1.284
+++ mail-format.c	6 Jun 2003 17:41:14 -0000
@@ -976,7 +976,7 @@
 	GConfClient *gconf;
 	int xmask, i;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	xmask = gconf_client_get_int (gconf, "/apps/evolution/mail/display/xmailer_mask", NULL);
 	
 	/* My favorite thing to do... muck around with colors so we respect people's stupid themes.
@@ -1130,7 +1130,7 @@
 		GConfClient *gconf;
 		char *charset;
 		
-		gconf = gconf_client_get_default ();
+		gconf = mail_config_get_gconf_client ();
 		
 		content_type = camel_data_wrapper_get_mime_type_field (wrapper);
 		
@@ -1236,7 +1236,7 @@
 	GdkColor colour;
 	char *buf;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES;
 	if (!md->printing) {
Index: mail-preferences.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-preferences.c,v
retrieving revision 1.31
diff -u -r1.31 mail-preferences.c
--- mail-preferences.c	20 May 2003 18:33:33 -0000	1.31
+++ mail-preferences.c	6 Jun 2003 17:41:15 -0000
@@ -29,7 +29,6 @@
 
 #include "mail-preferences.h"
 
-#include <gconf/gconf.h>
 #include <gal/util/e-iconv.h>
 #include <gtkhtml/gtkhtml-properties.h>
 #include "widgets/misc/e-charset-picker.h"
@@ -81,7 +80,7 @@
 static void
 mail_preferences_init (MailPreferences *preferences)
 {
-	preferences->gconf = gconf_client_get_default ();
+	preferences->gconf = mail_config_get_gconf_client ();
 }
 
 static void
@@ -90,7 +89,6 @@
 	MailPreferences *prefs = (MailPreferences *) obj;
 	
 	g_object_unref (prefs->gui);
-	g_object_unref (prefs->gconf);
 	
         ((GObjectClass *)(parent_class))->finalize (obj);
 }
Index: mail-session.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-session.c,v
retrieving revision 1.68
diff -u -r1.68 mail-session.c
--- mail-session.c	30 May 2003 03:01:47 -0000	1.68
+++ mail-session.c	6 Jun 2003 17:41:15 -0000
@@ -40,6 +40,7 @@
 #include "filter/filter-context.h"
 #include "filter/filter-filter.h"
 #include "mail.h"
+#include "mail-config.h"
 #include "mail-session.h"
 #include "mail-tools.h"
 #include "mail-mt.h"
@@ -815,7 +816,7 @@
 	RuleContext *fc;
 	long notify;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	user = g_strdup_printf ("%s/filters.xml", evolution_dir);
 	system = EVOLUTION_PRIVDATADIR "/filtertypes.xml";
Index: mail-tools.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-tools.c,v
retrieving revision 1.114
diff -u -r1.114 mail-tools.c
--- mail-tools.c	7 May 2003 00:53:40 -0000	1.114
+++ mail-tools.c	6 Jun 2003 17:41:16 -0000
@@ -45,8 +45,9 @@
 
 #include "e-util/e-meta.h"
 
-#include "mail-vfolder.h"
 #include "mail.h" /*session*/
+#include "mail-config.h"
+#include "mail-vfolder.h"
 #include "mail-format.h"
 #include "mail-tools.h"
 #include "mail-local.h"
@@ -354,7 +355,7 @@
 	char *text, *colour;
 	GConfClient *gconf;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 	contents = camel_medium_get_content_object (CAMEL_MEDIUM (message));
 	/* We pass "want_plain" for "cite", since if it's HTML, we'll
@@ -424,7 +425,7 @@
 	gboolean send_html;
 	GConfClient *gconf;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	send_html = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/send_html", NULL);
 	
 	body = mail_get_message_body (CAMEL_DATA_WRAPPER (message), !send_html, quoted);
Index: message-list.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.c,v
retrieving revision 1.340
diff -u -r1.340 message-list.c
--- message-list.c	16 May 2003 18:52:14 -0000	1.340
+++ message-list.c	6 Jun 2003 17:41:17 -0000
@@ -2218,7 +2218,7 @@
 		
 		camel_object_ref (camel_folder);
 		
-		gconf = gconf_client_get_default ();
+		gconf = mail_config_get_gconf_client ();
 		hide_deleted = !gconf_client_get_bool (gconf, "/apps/evolution/mail/display/show_deleted", NULL);
 		message_list->hidedeleted = hide_deleted && !(camel_folder->folder_flags & CAMEL_FOLDER_IS_TRASH);
 		
@@ -2858,7 +2858,7 @@
 		}
 	}
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	
 #ifndef BROKEN_ETREE
 	/* this can sometimes crash,so ... */
Index: message-tag-followup.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-tag-followup.c,v
retrieving revision 1.22
diff -u -r1.22 message-tag-followup.c
--- message-tag-followup.c	11 Apr 2003 21:18:08 -0000	1.22
+++ message-tag-followup.c	6 Jun 2003 17:41:17 -0000
@@ -221,10 +221,9 @@
 static int
 get_week_start_day (void)
 {
-	/* FIXME: make sure the gconf key is correct? */
 	GConfClient *gconf;
 	
-	gconf = gconf_client_get_default ();
+	gconf = mail_config_get_gconf_client ();
 	return gconf_client_get_int (gconf, "/apps/evolution/calendar/display/week_start_day", NULL);
 }
 
@@ -255,9 +254,8 @@
 	/* Note that this is 0 (Sun) to 6 (Sat), conver to 0 (mon) to 6 (sun) */
 	start = (get_week_start_day () + 6) % 7;
 	
-	/* FIXME: make sure the calendar gconf key is correct */
 	if (locale_supports_12_hour_format ()) {
-		gconf = gconf_client_get_default ();
+		gconf = mail_config_get_gconf_client ();
 		time_24hour = gconf_client_get_bool (gconf, "/apps/evolution/calendar/display/use_24hour_format", NULL);
 	}
 	


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]