Commit 22ef5aa7 authored by Matthew Barnes's avatar Matthew Barnes

Kill mail_config_get_gconf_client().

parent 35e55a8d
......@@ -795,16 +795,16 @@ headers_changed_cb (GConfClient *client,
static void
remove_header_notify_cb (gpointer data)
{
GConfClient *client = mail_config_get_gconf_client ();
GConfClient *client;
guint notify_id;
g_return_if_fail (client != NULL);
notify_id = GPOINTER_TO_INT (data);
g_return_if_fail (notify_id != 0);
client = gconf_client_get_default ();
gconf_client_notify_remove (client, notify_id);
gconf_client_remove_dir (client, "/apps/evolution/mail/display", NULL);
g_object_unref (client);
}
/**
......@@ -817,9 +817,11 @@ remove_header_notify_cb (gpointer data)
void
e_mail_reader_connect_headers (EMailReader *reader)
{
GConfClient *client = mail_config_get_gconf_client ();
GConfClient *client;
guint notify_id;
client = gconf_client_get_default ();
gconf_client_add_dir (
client, "/apps/evolution/mail/display",
GCONF_CLIENT_PRELOAD_NONE, NULL);
......@@ -833,4 +835,6 @@ e_mail_reader_connect_headers (EMailReader *reader)
GINT_TO_POINTER (notify_id), remove_header_notify_cb);
headers_changed_cb (client, 0, NULL, reader);
g_object_unref (client);
}
......@@ -442,7 +442,7 @@ action_mail_flag_for_followup_cb (GtkAction *action,
static void
check_close_browser_reader (EMailReader *reader)
{
GConfClient *gconf;
GConfClient *client;
gchar *value;
gboolean close_it = FALSE;
......@@ -452,8 +452,11 @@ check_close_browser_reader (EMailReader *reader)
if (!E_IS_MAIL_BROWSER (reader))
return;
gconf = mail_config_get_gconf_client ();
value = gconf_client_get_string (gconf, "/apps/evolution/mail/prompts/reply_close_browser", NULL);
client = gconf_client_get_default ();
value = gconf_client_get_string (
client, "/apps/evolution/mail/prompts/reply_close_browser", NULL);
if (value && g_str_equal (value, "always")) {
close_it = TRUE;
} else if (!value || !g_str_equal (value, "never")) {
......@@ -481,7 +484,7 @@ check_close_browser_reader (EMailReader *reader)
if (response == GTK_RESPONSE_OK || response == GTK_RESPONSE_CANCEL)
gconf_client_set_string (
gconf, "/apps/evolution/mail/prompts/reply_close_browser",
client, "/apps/evolution/mail/prompts/reply_close_browser",
response == GTK_RESPONSE_OK ? "always" : "never", NULL);
}
......@@ -489,6 +492,8 @@ check_close_browser_reader (EMailReader *reader)
if (close_it)
gtk_widget_destroy (GTK_WIDGET (reader));
g_object_unref (client);
}
static void
......@@ -1047,7 +1052,6 @@ action_mail_reply_all_check (CamelFolder *folder,
recip_count += camel_address_length (CAMEL_ADDRESS (cc));
if (recip_count >= 15) {
GConfClient *gconf = mail_config_get_gconf_client ();
GtkWidget *dialog;
GtkWidget *content_area, *check;
gint response;
......@@ -1065,8 +1069,15 @@ action_mail_reply_all_check (CamelFolder *folder,
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)))
gconf_client_set_bool (gconf, "/apps/evolution/mail/prompts/reply_many_recips", FALSE, NULL);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))) {
GConfClient *client;
const gchar *key;
client = gconf_client_get_default ();
key = "/apps/evolution/mail/prompts/reply_many_recips";
gconf_client_set_bool (client, key, FALSE, NULL);
g_object_unref (client);
}
gtk_widget_destroy (dialog);
......@@ -1084,11 +1095,19 @@ static void
action_mail_reply_all_cb (GtkAction *action,
EMailReader *reader)
{
guint32 state = e_mail_reader_check_state (reader);
GConfClient *gconf = mail_config_get_gconf_client ();
GConfClient *client;
const gchar *key;
guint32 state;
gboolean ask;
if (gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/reply_many_recips", NULL) &&
!(state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
state = e_mail_reader_check_state (reader);
client = gconf_client_get_default ();
key = "/apps/evolution/mail/prompts/reply_many_recips";
ask = gconf_client_get_bool (client, key, NULL);
g_object_unref (client);
if (ask && !(state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
CamelMimeMessage *message = NULL;
EWebView *web_view;
EMFormatHTML *formatter;
......@@ -1126,10 +1145,17 @@ static void
action_mail_reply_group_cb (GtkAction *action,
EMailReader *reader)
{
GConfClient *gconf = mail_config_get_gconf_client ();
gboolean reply_list = gconf_client_get_bool (gconf,
"/apps/evolution/mail/composer/group_reply_to_list", NULL);
guint32 state = e_mail_reader_check_state (reader);
GConfClient *client;
gboolean reply_list;
const gchar *key;
guint32 state;
state = e_mail_reader_check_state (reader);
client = gconf_client_get_default ();
key = "/apps/evolution/mail/composer/group_reply_to_list";
reply_list = gconf_client_get_bool (client, key, NULL);
g_object_unref (client);
if (reply_list && (state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
e_mail_reader_reply_to_message (reader, NULL, REPLY_MODE_LIST);
......@@ -1152,21 +1178,34 @@ action_mail_reply_sender_check (CamelFolder *folder,
CamelMimeMessage *message,
gpointer user_data)
{
GConfClient *gconf = mail_config_get_gconf_client ();
EMailReader *reader = user_data;
GConfClient *client;
gint mode = REPLY_MODE_SENDER;
const gchar *key;
gboolean ask_ignore_list_reply_to;
gboolean ask_list_reply_to;
gboolean munged_list_message;
if (!message)
return;
client = gconf_client_get_default ();
key = "/apps/evolution/mail/composer/ignore_list_reply_to";
ask_ignore_list_reply_to = gconf_client_get_bool (client, key, NULL);
key = "/apps/evolution/mail/prompts/list_reply_to";
ask_list_reply_to = gconf_client_get_bool (client, key, NULL);
munged_list_message = em_utils_is_munged_list_message (message);
/* get_message_free () will unref the message, so we need to take an
extra ref for e_mail_reader_reply_to_message () to own. */
g_object_ref (message);
/* Don't do the "Are you sure you want to reply in private?" pop-up if
it's a Reply-To: munged list message... unless we're ignoring munging */
if (gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/ignore_list_reply_to", NULL)
|| !em_utils_is_munged_list_message (message)) {
if (ask_ignore_list_reply_to || !munged_list_message) {
GtkWidget *dialog;
GtkWidget *content_area, *check;
gint response;
......@@ -1188,7 +1227,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)))
gconf_client_set_bool (
gconf, "/apps/evolution/mail/prompts/private_list_reply", FALSE, NULL);
client, "/apps/evolution/mail/prompts/private_list_reply", FALSE, NULL);
gtk_widget_destroy (dialog);
......@@ -1197,8 +1236,9 @@ action_mail_reply_sender_check (CamelFolder *folder,
else if (response == GTK_RESPONSE_OK)
mode = REPLY_MODE_LIST;
else if (response == GTK_RESPONSE_CANCEL)
return;
} else if (gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/list_reply_to", NULL)) {
goto exit;
} else if (ask_list_reply_to) {
GtkWidget *dialog;
GtkWidget *content_area;
GtkWidget *vbox;
......@@ -1232,10 +1272,10 @@ action_mail_reply_sender_check (CamelFolder *folder,
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_again)))
gconf_client_set_bool (
gconf, "/apps/evolution/mail/prompts/list_reply_to", FALSE, NULL);
client, "/apps/evolution/mail/prompts/list_reply_to", FALSE, NULL);
gconf_client_set_bool (
gconf, "/apps/evolution/mail/composer/ignore_list_reply_to",
client, "/apps/evolution/mail/composer/ignore_list_reply_to",
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_always_ignore)),
NULL);
......@@ -1246,23 +1286,37 @@ action_mail_reply_sender_check (CamelFolder *folder,
else if (response == GTK_RESPONSE_OK)
mode = REPLY_MODE_LIST;
else if (response == GTK_RESPONSE_CANCEL)
return;
goto exit;
}
e_mail_reader_reply_to_message (reader, message, mode);
check_close_browser_reader (reader);
exit:
g_object_unref (client);
}
static void
action_mail_reply_sender_cb (GtkAction *action,
EMailReader *reader)
{
GConfClient *gconf;
GConfClient *client;
gboolean ask_list_reply_to;
gboolean ask_private_list_reply;
const gchar *key;
guint32 state;
state = e_mail_reader_check_state (reader);
client = gconf_client_get_default ();
key = "/apps/evolution/mail/prompts/list_reply_to";
ask_list_reply_to = gconf_client_get_bool (client, key, NULL);
key = "/apps/evolution/mail/prompts/private_list_reply";
ask_private_list_reply = gconf_client_get_bool (client, key, NULL);
g_object_unref (client);
gconf = mail_config_get_gconf_client ();
if ((gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/private_list_reply", NULL) ||
gconf_client_get_bool (gconf, "/apps/evolution/mail/prompts/list_reply_to", NULL)) &&
e_mail_reader_check_state (reader) & E_MAIL_READER_SELECTION_IS_MAILING_LIST) {
if ((ask_private_list_reply || ask_list_reply_to) &&
state & E_MAIL_READER_SELECTION_IS_MAILING_LIST) {
CamelMimeMessage *message = NULL;
EWebView *web_view;
EMFormatHTML *formatter;
......
......@@ -284,10 +284,10 @@ main_get_filter_driver (CamelSession *session,
EFilterRule *rule = NULL;
const gchar *config_dir;
gchar *user, *system;
GConfClient *gconf;
GConfClient *client;
ERuleContext *fc;
gconf = mail_config_get_gconf_client ();
client = gconf_client_get_default ();
config_dir = mail_session_get_config_dir ();
user = g_build_filename (config_dir, "filters.xml", NULL);
......@@ -300,11 +300,11 @@ main_get_filter_driver (CamelSession *session,
driver = camel_filter_driver_new (session);
camel_filter_driver_set_folder_func (driver, get_folder, session);
if (gconf_client_get_bool (gconf, "/apps/evolution/mail/filters/log", NULL)) {
if (gconf_client_get_bool (client, "/apps/evolution/mail/filters/log", NULL)) {
if (ms->priv->filter_logfile == NULL) {
gchar *filename;
filename = gconf_client_get_string (gconf, "/apps/evolution/mail/filters/logfile", NULL);
filename = gconf_client_get_string (client, "/apps/evolution/mail/filters/logfile", NULL);
if (filename) {
ms->priv->filter_logfile = g_fopen (filename, "a+");
g_free (filename);
......@@ -354,6 +354,8 @@ main_get_filter_driver (CamelSession *session,
g_object_unref (fc);
g_object_unref (client);
return driver;
}
......@@ -381,12 +383,15 @@ ms_forward_to_cb (CamelFolder *folder,
gpointer data)
{
EMailSession *session = E_MAIL_SESSION (data);
GConfClient *client;
client = gconf_client_get_default ();
camel_message_info_free (info);
/* do not call mail send immediately, just pile them all in the outbox */
if (preparing_flush ||
gconf_client_get_bool (mail_config_get_gconf_client (), "/apps/evolution/mail/filters/flush-outbox", NULL)) {
gconf_client_get_bool (client, "/apps/evolution/mail/filters/flush-outbox", NULL)) {
if (preparing_flush)
g_source_remove (preparing_flush);
......@@ -394,6 +399,8 @@ ms_forward_to_cb (CamelFolder *folder,
60, (GSourceFunc)
forward_to_flush_outbox_cb, session);
}
g_object_unref (client);
}
/* Support for SOCKS proxy ***************************************************/
......@@ -410,7 +417,7 @@ set_socks_proxy_from_gconf (CamelSession *session)
gchar *mode, *host;
gint port;
client = mail_config_get_gconf_client ();
client = gconf_client_get_default ();
mode = gconf_client_get_string (client, MODE_PROXY, NULL);
if (!g_strcmp0(mode, "manual")) {
......@@ -420,6 +427,8 @@ set_socks_proxy_from_gconf (CamelSession *session)
g_free (host);
}
g_free (mode);
g_object_unref (client);
}
static void
......@@ -443,7 +452,7 @@ set_socks_proxy_gconf_watch (CamelSession *session)
{
GConfClient *client;
client = mail_config_get_gconf_client ();
client = gconf_client_get_default ();
gconf_client_add_dir (
client, DIR_PROXY,
......@@ -451,6 +460,8 @@ set_socks_proxy_gconf_watch (CamelSession *session)
session_gconf_proxy_id = gconf_client_notify_add (
client, DIR_PROXY, proxy_gconf_notify_cb,
session, NULL, NULL); /* NULL-GError */
g_object_unref (client);
}
static void
......@@ -552,7 +563,7 @@ mail_session_finalize (GObject *object)
{
GConfClient *client;
client = mail_config_get_gconf_client ();
client = gconf_client_get_default ();
if (session_check_junk_notify_id != 0) {
gconf_client_notify_remove (client, session_check_junk_notify_id);
......@@ -564,6 +575,8 @@ mail_session_finalize (GObject *object)
session_gconf_proxy_id = 0;
}
g_object_unref (client);
g_free (mail_data_dir);
g_free (mail_config_dir);
......@@ -1374,14 +1387,16 @@ mail_session_add_junk_plugin (EMailSession *session,
const gchar *plugin_name,
CamelJunkPlugin *junk_plugin)
{
GConfClient *gconf;
GConfClient *client;
gchar *def_plugin;
const gchar *key;
g_return_if_fail (E_IS_MAIL_SESSION (session));
gconf = mail_config_get_gconf_client ();
def_plugin = gconf_client_get_string (
gconf, "/apps/evolution/mail/junk/default_plugin", NULL);
client = gconf_client_get_default ();
key = "/apps/evolution/mail/junk/default_plugin";
def_plugin = gconf_client_get_string (client, key, NULL);
g_object_unref (client);
session->priv->junk_plugins = g_list_append (
session->priv->junk_plugins, junk_plugin);
......
......@@ -611,119 +611,6 @@ emae_account_url (EMAccountEditor *emae, gint urlid)
}
/* ********************************************************************** */
static void
emae_license_state (GtkToggleButton *button, GtkDialog *dialog)
{
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_ACCEPT,
gtk_toggle_button_get_active (button));
}
static gboolean
emae_load_text (GtkTextView *view, const gchar *filename)
{
FILE *fd;
gchar filebuf[1024];
GtkTextIter iter;
GtkTextBuffer *buffer;
gint count;
g_return_val_if_fail (filename != NULL , FALSE);
fd = g_fopen (filename, "r");
if (fd) {
buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_get_start_iter (buffer, &iter);
while (!feof (fd) && !ferror (fd)) {
count = fread (filebuf, 1, sizeof (filebuf), fd);
gtk_text_buffer_insert (buffer, &iter, filebuf, count);
}
gtk_text_view_set_buffer (GTK_TEXT_VIEW (view), GTK_TEXT_BUFFER (buffer));
fclose (fd);
}
return fd != NULL;
}
static gboolean
emae_display_license (EMAccountEditor *emae, CamelProvider *prov)
{
GtkBuilder *builder;
GtkWidget *w, *dialog;
gchar *tmp;
GtkResponseType response = GTK_RESPONSE_NONE;
builder = gtk_builder_new ();
e_load_ui_builder_definition (builder, "mail-dialogs.ui");
dialog = e_builder_get_widget (builder, "license_dialog");
gtk_dialog_set_response_sensitive ((GtkDialog *)dialog, GTK_RESPONSE_ACCEPT, FALSE);
tmp = g_strdup_printf (_("%s License Agreement"), prov->license);
gtk_window_set_title ((GtkWindow *)dialog, tmp);
g_free (tmp);
g_signal_connect (e_builder_get_widget (builder, "license_checkbutton"),
"toggled", G_CALLBACK(emae_license_state), dialog);
tmp = g_strdup_printf (_("\nPlease read carefully the license agreement\n"
"for %s displayed below\n"
"and tick the check box for accepting it\n"), prov->license);
gtk_label_set_text ((GtkLabel *)e_builder_get_widget (builder, "license_top_label"), tmp);
g_free (tmp);
w = e_builder_get_widget (builder, "license_textview");
if (emae_load_text ((GtkTextView *)w, prov->license_file)) {
gtk_text_view_set_editable ((GtkTextView *)w, FALSE);
response = gtk_dialog_run ((GtkDialog *)dialog);
} else {
GtkWidget *editor;
GtkWindow *window;
editor = E_CONFIG (emae->config)->window;
if (editor != NULL)
window = (GtkWindow *) gtk_widget_get_toplevel (editor);
else
window = e_shell_get_active_window (NULL);
e_alert_run_dialog_for_args (
window, "mail:no-load-license",
prov->license_file, NULL);
}
gtk_widget_destroy (dialog);
g_object_unref (builder);
return (response == GTK_RESPONSE_ACCEPT);
}
static gboolean
emae_check_license (EMAccountEditor *emae, CamelProvider *prov)
{
gboolean accepted = TRUE;
if (prov->flags & CAMEL_PROVIDER_HAS_LICENSE) {
GConfClient *gconf = mail_config_get_gconf_client ();
GSList *providers_list, *l;
providers_list = gconf_client_get_list (gconf, "/apps/evolution/mail/licenses", GCONF_VALUE_STRING, NULL);
for (l = providers_list, accepted = FALSE; l && !accepted; l = g_slist_next (l))
accepted = (strcmp ((gchar *)l->data, prov->protocol) == 0);
if (!accepted
&& (accepted = emae_display_license (emae, prov)) == TRUE) {
providers_list = g_slist_append (providers_list, g_strdup (prov->protocol));
gconf_client_set_list (gconf,
"/apps/evolution/mail/licenses",
GCONF_VALUE_STRING,
providers_list, NULL);
}
g_slist_foreach (providers_list, (GFunc)g_free, NULL);
g_slist_free (providers_list);
}
return accepted;
}
static void
default_folders_clicked (GtkButton *button, gpointer user_data)
......@@ -995,9 +882,6 @@ emae_setup_signatures (EMAccountEditor *emae, GtkBuilder *builder)
button = e_builder_get_widget (builder, "sigAddNew");
g_signal_connect (button, "clicked", G_CALLBACK(emae_signature_new), emae);
gtk_widget_set_sensitive (button,
gconf_client_key_is_writable (mail_config_get_gconf_client (),
"/apps/evolution/mail/signatures", NULL));
return (GtkWidget *)dropdown;
}
......@@ -1658,10 +1542,7 @@ emae_service_provider_changed (EMAccountEditorService *service)
camel_url_set_protocol (url, service->provider->protocol);
gtk_label_set_text (service->description, service->provider->description);
if (!emae_check_license (service->emae, service->provider))
gtk_widget_hide (service->frame);
else
gtk_widget_show (service->frame);
gtk_widget_show (service->frame);
enable = e_account_writable_option (account, service->provider->protocol, "auth");
gtk_widget_set_sensitive ((GtkWidget *)service->authtype, enable);
......
......@@ -1505,7 +1505,8 @@ em_utils_forward_message (EShell *shell,
{
GPtrArray *messages;
CamelMimePart *part;
GConfClient *gconf;
GConfClient *client;
const gchar *key;
gchar *subject;
gint mode;
EMsgComposer *composer = NULL;
......@@ -1515,8 +1516,10 @@ em_utils_forward_message (EShell *shell,
messages = g_ptr_array_new ();
g_ptr_array_add (messages, message);
gconf = mail_config_get_gconf_client ();
mode = gconf_client_get_int (gconf, "/apps/evolution/mail/format/forward_style", NULL);
client = gconf_client_get_default ();
key = "/apps/evolution/mail/format/forward_style";
mode = gconf_client_get_int (client, key, NULL);
g_object_unref (client);
switch (mode) {
case MAIL_CONFIG_FORWARD_ATTACHED:
......@@ -1565,13 +1568,16 @@ em_utils_forward_messages (EShell *shell,
GPtrArray *uids,
const gchar *from_uri)
{
GConfClient *gconf;
GConfClient *client;
const gchar *key;
gint mode;
g_return_if_fail (E_IS_SHELL (shell));
gconf = mail_config_get_gconf_client ();
mode = gconf_client_get_int (gconf, "/apps/evolution/mail/format/forward_style", NULL);
client = gconf_client_get_default ();
key = "/apps/evolution/mail/format/forward_style";
mode = gconf_client_get_int (client, key, NULL);
g_object_unref (client);
switch (mode) {
case MAIL_CONFIG_FORWARD_ATTACHED:
......@@ -2103,12 +2109,14 @@ get_reply_to (CamelMimeMessage *message)
reply_to = camel_mime_message_get_reply_to (message);
if (reply_to) {
GConfClient *gconf;
GConfClient *client;
const gchar *key;
gboolean ignore_list_reply_to;
gconf = mail_config_get_gconf_client ();
ignore_list_reply_to = gconf_client_get_bool (gconf,
"/apps/evolution/mail/composer/ignore_list_reply_to", NULL);
client = gconf_client_get_default ();
key = "/apps/evolution/mail/composer/ignore_list_reply_to";
ignore_list_reply_to = gconf_client_get_bool (client, key, NULL);
g_object_unref (client);
if (ignore_list_reply_to && em_utils_is_munged_list_message (message))
reply_to = NULL;
......@@ -2448,15 +2456,22 @@ composer_set_body (EMsgComposer *composer, CamelMimeMessage *message, EMFormat *
{
gchar *text, *credits;
CamelMimePart *part;
GConfClient *gconf;
GConfClient *client;
gssize len = 0;
gboolean start_bottom;
guint32 validity_found = 0;
const gchar *key;
MailConfigReplyStyle style;
client = gconf_client_get_default ();
gconf = mail_config_get_gconf_client ();
start_bottom = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/reply_start_bottom", NULL);
key = "/apps/evolution/mail/composer/reply_start_bottom";
start_bottom = gconf_client_get_bool (client, key, NULL);
switch (gconf_client_get_int (gconf, "/apps/evolution/mail/format/reply_style", NULL)) {
key = "/apps/evolution/mail/format/reply_style";
style = gconf_client_get_int (client, key, NULL);
switch (style) {
case MAIL_CONFIG_REPLY_DO_NOT_QUOTE:
/* do nothing */
break;
......@@ -2493,13 +2508,15 @@ composer_set_body (EMsgComposer *composer, CamelMimeMessage *message, EMFormat *
before the signature. We added there an empty line already. */
gtkhtml_editor_run_command (editor, "block-selection");
gtkhtml_editor_run_command (editor, "cursor-bod");
if (gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/top_signature", NULL)
if (gconf_client_get_bool (client, "/apps/evolution/mail/composer/top_signature", NULL)
|| !gtkhtml_editor_search_by_data (editor, 1, "ClueFlow", "signature", "1"))
gtkhtml_editor_run_command (editor, "cursor-eod");
else
gtkhtml_editor_run_command (editor, "selection-move-left");
gtkhtml_editor_run_command (editor, "unblock-selection");
}
g_object_unref (client);
}
struct _reply_data {
......
......@@ -222,8 +222,9 @@ emfp_dialog_got_folder_quota (CamelFolder *folder,
CamelStore *local_store;
CamelStore *parent_store;
gboolean hide_deleted;
GConfClient *gconf;
GConfClient *client;
const gchar *name;
const gchar *key;
if (folder == NULL)
return;
......@@ -238,17 +239,18 @@ emfp_dialog_got_folder_quota (CamelFolder *folder,
prop_data->object = g_object_ref (folder);
prop_data->quota = camel_folder_quota_info_clone (quota);
/*
Get number of VISIBLE and DELETED messages, instead of TOTAL messages. VISIBLE+DELETED
gives the correct count that matches the label below the Send & Receive button
*/
/* Get number of VISIBLE and DELETED messages, instead of TOTAL
* messages. VISIBLE+DELETED gives the correct count that matches
* the label below the Send & Receive button. */
name = camel_folder_get_name (folder);
prop_data->total = folder->summary->visible_count;
prop_data->unread = folder->summary->unread_count;
deleted = folder->summary->deleted_count;
gconf = mail_config_get_gconf_client ();
hide_deleted = !gconf_client_get_bool(gconf, "/apps/evolution/mail/display/show_deleted", NULL);
client = gconf_client_get_default ();
key = "/apps/evolution/mail/display/show_deleted";
hide_deleted = !gconf_client_get_bool(client, key, NULL);
g_object_unref (client);
/*
Do the calculation only for those accounts that support VTRASHes
......
......@@ -1258,10 +1258,10 @@ folder_tree_new (EMFolderTree *folder_tree)
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
GtkWidget *tree;
GConfClient *gconf;
GConfClient *client;
const gchar *key;
gconf = mail_config_get_gconf_client ();
client = gconf_client_get_default ();
/* FIXME Gross hack */
tree = GTK_WIDGET (folder_tree);
......@@ -1282,7 +1282,7 @@ folder_tree_new (EMFolderTree *folder_tree)
renderer = gtk_cell_renderer_text_new ();
key = "/apps/evolution/mail/display/no_folder_dots";
if (!gconf_client_get_bool (gconf, key, NULL))
if (!gconf_client_get_bool (client, key, NULL))
g_object_set (
renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
......@@ -1303,6 +1303,8 @@ folder_tree_new (EMFolderTree *folder_tree)
gtk_tree_view_set_search_column ((GtkTreeView *)tree, COL_STRING_DISPLAY_NAME);
g_object_unref (client);
return (GtkTreeView *) tree;
}
......
......@@ -124,18 +124,24 @@ em_utils_ask_open_many (GtkWindow *parent,
* Returns %TRUE if the user clicks Yes or %FALSE otherwise.
**/
gboolean
em_utils_prompt_user (GtkWindow *parent, const gchar *promptkey, const gchar *tag, ...)
em_utils_prompt_user (GtkWindow *parent,
const gchar *promptkey,
const gchar *tag,
...)
{
GtkWidget *mbox, *check = NULL;
GtkWidget *container;
va_list ap;
gint button;
GConfClient *gconf = mail_config_get_gconf_client ();
GConfClient *client;
EAlert *alert = NULL;
if (promptkey
&& !gconf_client_get_bool (gconf, promptkey, NULL))
client = gconf_client_get_default ();
if (promptkey && !gconf_client_get_bool (client, promptkey, NULL)) {
g_object_unref (client);
return TRUE;
}
va_start (ap, tag);
alert = e_alert_new_valist (tag, ap);
......@@ -154,10 +160,15 @@ em_utils_prompt_user (GtkWindow *parent, const gchar *promptkey, const gchar *ta
button = gtk_dialog_run ((GtkDialog *) mbox);
if (promptkey)
gconf_client_set_bool (gconf, promptkey, !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)), NULL);