From c0a255eb90769638d57ae4122932f75c46e4e531 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 11 Sep 2008 15:34:29 +0000 Subject: Merge revisions 36016:36303 from trunk. svn path=/branches/kill-bonobo/; revision=36307 --- mail/mail-session.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 00e4c64405..d86242d393 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -1,24 +1,26 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* mail-session.c: handles the session information and resource manipulation */ /* - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * + * Authors: + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * */ +/* mail-session.c: handles the session information and resource manipulation */ + #include #include @@ -711,6 +713,12 @@ mail_session_init (const char *base_directory) g_free (camel_dir); } +void +mail_session_shutdown (void) +{ + camel_shutdown (); +} + gboolean mail_session_get_interactive (void) { -- cgit v1.2.3 From b2cda1d0c6d44f53f71bad9e256f41188677dfba Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 1 Oct 2008 20:56:04 +0000 Subject: Merge revisions 36016:36533 from trunk. svn path=/branches/kill-bonobo/; revision=36534 --- mail/mail-session.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index d86242d393..9009bb607b 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -171,7 +171,7 @@ get_password (CamelSession *session, CamelService *service, const char *domain, char *ret = NULL; EAccount *account = NULL; - url = service?camel_url_to_string(service->url, CAMEL_URL_HIDE_ALL):NULL; + url = service ? camel_url_to_string (service->url, CAMEL_URL_HIDE_ALL & (~CAMEL_URL_HIDE_AUTH)) : NULL; if (!strcmp(item, "popb4smtp_uri")) { /* not 100% mt safe, but should be ok */ @@ -286,20 +286,13 @@ struct _user_message_msg { static void user_message_exec (struct _user_message_msg *m); -/* clicked, send back the reply */ static void -user_message_response (GtkDialog *dialog, int button, struct _user_message_msg *m) +user_message_response_free (GtkDialog *dialog, int button, struct _user_message_msg *m) { gtk_widget_destroy ((GtkWidget *) dialog); user_message_dialog = NULL; - /* if !allow_cancel, then we've already replied */ - if (m->allow_cancel) { - m->result = button == GTK_RESPONSE_OK; - e_flag_set (m->done); - } - /* check for pendings */ if (!g_queue_is_empty (&user_message_queue)) { m = g_queue_pop_head (&user_message_queue); @@ -308,6 +301,19 @@ user_message_response (GtkDialog *dialog, int button, struct _user_message_msg * } } +/* clicked, send back the reply */ +static void +user_message_response (GtkDialog *dialog, int button, struct _user_message_msg *m) +{ + /* if !allow_cancel, then we've already replied */ + if (m->allow_cancel) { + m->result = button == GTK_RESPONSE_OK; + e_flag_set (m->done); + } + + user_message_response_free (dialog, button, m); +} + static void user_message_exec (struct _user_message_msg *m) { @@ -364,7 +370,7 @@ user_message_exec (struct _user_message_msg *m) } else { g_signal_connect ( user_message_dialog, "response", - G_CALLBACK (user_message_response), m); + G_CALLBACK (user_message_response_free), m); g_object_set_data ( user_message_dialog, "response-handled", GINT_TO_POINTER (TRUE)); @@ -375,8 +381,8 @@ user_message_exec (struct _user_message_msg *m) static void user_message_free (struct _user_message_msg *m) { - g_free(m->prompt); - e_flag_free(m->done); + g_free (m->prompt); + e_flag_free (m->done); } static MailMsgInfo user_message_info = { -- cgit v1.2.3 From 54b80a7271e8ce1b2f3ccc68bb553940a24b80e2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 17 Oct 2008 03:48:03 +0000 Subject: Get the mail folder tree compiling, though I'm not yet sure why it's not showing anything. Probably something stupid. Also enabled the composer. svn path=/branches/kill-bonobo/; revision=36623 --- mail/mail-session.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 9009bb607b..1de1ecfe61 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -50,7 +50,6 @@ #include "em-filter-context.h" #include "em-filter-rule.h" #include "em-utils.h" -#include "mail-component.h" #include "mail-config.h" #include "mail-mt.h" #include "mail-ops.h" @@ -82,6 +81,7 @@ typedef struct _MailSessionClass { } MailSessionClass; +static EShellModule *mail_shell_module; static CamelSessionClass *ms_parent_class; static char *get_password(CamelSession *session, CamelService *service, const char *domain, const char *prompt, const char *item, guint32 flags, CamelException *ex); @@ -499,13 +499,15 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException { CamelFilterDriver *driver; FilterRule *rule = NULL; + const gchar *data_dir; char *user, *system; GConfClient *gconf; RuleContext *fc; gconf = mail_config_get_gconf_client (); - user = g_strdup_printf ("%s/filters.xml", mail_component_peek_base_directory (mail_component_peek ())); + data_dir = e_shell_module_get_data_dir (mail_shell_module); + user = g_build_filename (data_dir, "filters.xml", NULL); system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL); fc = (RuleContext *) em_filter_context_new (); rule_context_load (fc, system, user); @@ -688,12 +690,15 @@ mail_session_check_junk_notify (GConfClient *gconf, guint id, GConfEntry *entry, } void -mail_session_init (const char *base_directory) +mail_session_init (EShellModule *shell_module) { - char *camel_dir; + const gchar *data_dir; GConfClient *gconf; - if (camel_init (base_directory, TRUE) != 0) + mail_shell_module = shell_module; + data_dir = e_shell_module_get_data_dir (shell_module); + + if (camel_init (data_dir, TRUE) != 0) exit (0); camel_provider_init(); @@ -702,8 +707,7 @@ mail_session_init (const char *base_directory) e_account_combo_box_set_session (session); /* XXX Don't ask... */ e_account_writable(NULL, E_ACCOUNT_SOURCE_SAVE_PASSWD); /* Init the EAccount Setup */ - camel_dir = g_strdup_printf ("%s/mail", base_directory); - camel_session_construct (session, camel_dir); + camel_session_construct (session, data_dir); gconf = mail_config_get_gconf_client (); gconf_client_add_dir (gconf, "/apps/evolution/mail/junk", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); @@ -716,7 +720,6 @@ mail_session_init (const char *base_directory) /* The shell will tell us to go online. */ camel_session_set_online ((CamelSession *) session, FALSE); mail_config_reload_junk_headers (); - g_free (camel_dir); } void -- cgit v1.2.3 From 85b2913a380c69f14ae0254ad23b10fabfb33667 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 24 Oct 2008 23:52:05 +0000 Subject: Merge revisions 36534:36684 from trunk. svn path=/branches/kill-bonobo/; revision=36685 --- mail/mail-session.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 1de1ecfe61..3e7befb08d 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -171,13 +171,15 @@ get_password (CamelSession *session, CamelService *service, const char *domain, char *ret = NULL; EAccount *account = NULL; - url = service ? camel_url_to_string (service->url, CAMEL_URL_HIDE_ALL & (~CAMEL_URL_HIDE_AUTH)) : NULL; + url = service?camel_url_to_string(service->url, CAMEL_URL_HIDE_ALL):NULL; if (!strcmp(item, "popb4smtp_uri")) { /* not 100% mt safe, but should be ok */ if (url && (account = mail_config_get_account_by_transport_url(url))) ret = g_strdup(account->source->url); + else + ret = g_strdup(url); } else { char *key = make_key(service, item); EAccountService *config_service = NULL; -- cgit v1.2.3 From 7ed2b90bdad0637d72be1815e6634bb352d0ec08 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 14 Jan 2009 12:45:10 +0000 Subject: Fix online mode initialization. svn path=/branches/kill-bonobo/; revision=37070 --- mail/mail-session.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 3e7befb08d..990c42ae5d 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -46,6 +46,7 @@ #include "e-util/e-error.h" #include "e-util/e-util-private.h" #include "e-account-combo-box.h" +#include "shell/e-shell.h" #include "em-filter-context.h" #include "em-filter-rule.h" @@ -694,12 +695,17 @@ mail_session_check_junk_notify (GConfClient *gconf, guint id, GConfEntry *entry, void mail_session_init (EShellModule *shell_module) { - const gchar *data_dir; + EShell *shell; GConfClient *gconf; + gboolean online_mode; + const gchar *data_dir; mail_shell_module = shell_module; data_dir = e_shell_module_get_data_dir (shell_module); + shell = e_shell_module_get_shell (shell_module); + online_mode = e_shell_get_online_mode (shell); + if (camel_init (data_dir, TRUE) != 0) exit (0); @@ -719,8 +725,7 @@ mail_session_init (EShellModule *shell_module) session, NULL, NULL); session->junk_plugin = NULL; - /* The shell will tell us to go online. */ - camel_session_set_online ((CamelSession *) session, FALSE); + camel_session_set_online ((CamelSession *) session, online_mode); mail_config_reload_junk_headers (); } -- cgit v1.2.3 From e17e550ce0ed64d984a9011cfeba30ed8391ecbe Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 16 Jan 2009 04:01:50 +0000 Subject: Give camel_init() the correct path, and suddenly the mail module is USABLE! svn path=/branches/kill-bonobo/; revision=37083 --- mail/mail-session.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 990c42ae5d..0e978ecdd0 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -43,6 +43,7 @@ #include #include +#include "e-util/e-util.h" #include "e-util/e-error.h" #include "e-util/e-util-private.h" #include "e-account-combo-box.h" @@ -701,11 +702,11 @@ mail_session_init (EShellModule *shell_module) const gchar *data_dir; mail_shell_module = shell_module; - data_dir = e_shell_module_get_data_dir (shell_module); shell = e_shell_module_get_shell (shell_module); online_mode = e_shell_get_online_mode (shell); + data_dir = e_get_user_data_dir (); if (camel_init (data_dir, TRUE) != 0) exit (0); @@ -715,6 +716,7 @@ mail_session_init (EShellModule *shell_module) e_account_combo_box_set_session (session); /* XXX Don't ask... */ e_account_writable(NULL, E_ACCOUNT_SOURCE_SAVE_PASSWD); /* Init the EAccount Setup */ + data_dir = e_shell_module_get_data_dir (shell_module); camel_session_construct (session, data_dir); gconf = mail_config_get_gconf_client (); -- cgit v1.2.3 From ab00f5b08adb1d74a0c70d935a32ffd982e86f34 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 21 Jan 2009 02:52:05 +0000 Subject: Merge revisions 37075:37107 from trunk. svn path=/branches/kill-bonobo/; revision=37112 --- mail/mail-session.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 0e978ecdd0..e4af8e1c29 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -49,6 +49,7 @@ #include "e-account-combo-box.h" #include "shell/e-shell.h" +#include "em-composer-utils.h" #include "em-filter-context.h" #include "em-filter-rule.h" #include "em-utils.h" @@ -95,6 +96,7 @@ static gboolean lookup_addressbook(CamelSession *session, const char *name); static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc); static void *ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size); static void ms_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *m); +static void ms_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex); static void init (MailSession *session) @@ -126,6 +128,7 @@ class_init (MailSessionClass *mail_session_class) camel_session_class->thread_msg_new = ms_thread_msg_new; camel_session_class->thread_msg_free = ms_thread_msg_free; camel_session_class->thread_status = ms_thread_status; + camel_session_class->forward_to = ms_forward_to; } static CamelType @@ -622,6 +625,16 @@ static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, printf("Thread status '%s' %d%%\n", text, pc); } +static void +ms_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex) +{ + g_return_if_fail (session != NULL); + g_return_if_fail (message != NULL); + g_return_if_fail (address != NULL); + + em_utils_forward_message_raw (folder, message, address, ex); +} + char * mail_session_get_password (const char *url_string) { -- cgit v1.2.3 From bc80332460c353e391cd620f2cc51f7b56eef4de Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 26 Jan 2009 18:49:51 +0000 Subject: Miscellaneous stuff. svn path=/branches/kill-bonobo/; revision=37134 --- mail/mail-session.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index e4af8e1c29..6529cde8f1 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -783,13 +783,6 @@ mail_session_set_interactive (gboolean interactive) } } -void -mail_session_forget_passwords (BonoboUIComponent *uih, void *user_data, - const char *path) -{ - e_passwords_forget_passwords (); -} - void mail_session_flush_filter_log (void) { -- cgit v1.2.3 From 0110c94c6abdbb25b4fea6a21f20f00b82a0fdd8 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 19 Feb 2009 05:52:33 +0000 Subject: Rename EShell:online-mode to EShell:online and update docs. Use EBindings instead of a notify callback to keep other widgets and actions synchronized with EShell:online. Cleaner and less error prone. svn path=/branches/kill-bonobo/; revision=37293 --- mail/mail-session.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 6529cde8f1..58b675828a 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -711,13 +711,13 @@ mail_session_init (EShellModule *shell_module) { EShell *shell; GConfClient *gconf; - gboolean online_mode; + gboolean online; const gchar *data_dir; mail_shell_module = shell_module; shell = e_shell_module_get_shell (shell_module); - online_mode = e_shell_get_online_mode (shell); + online = e_shell_get_online (shell); data_dir = e_get_user_data_dir (); if (camel_init (data_dir, TRUE) != 0) @@ -740,7 +740,7 @@ mail_session_init (EShellModule *shell_module) session, NULL, NULL); session->junk_plugin = NULL; - camel_session_set_online ((CamelSession *) session, online_mode); + camel_session_set_online ((CamelSession *) session, online); mail_config_reload_junk_headers (); } -- cgit v1.2.3 From faf1c14c11f3e6026f786e9587715c10b13c723e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 25 Apr 2009 10:16:00 -0400 Subject: Manual conflict resolution --- mail/mail-session.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index b1776664fb..58b675828a 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -750,12 +750,6 @@ mail_session_shutdown (void) camel_shutdown (); } -void -mail_session_shutdown (void) -{ - camel_shutdown (); -} - gboolean mail_session_get_interactive (void) { -- cgit v1.2.3 From 63889c5f1275fec81cb5ede6b09d1e058e31e7f2 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 30 Apr 2009 16:56:58 +0200 Subject: Bug #570730 - Get rid of gnome-config in Evolution --- mail/mail-session.c | 1 - 1 file changed, 1 deletion(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 8e7b2177c5..df5d35c179 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -33,7 +33,6 @@ #include -#include #include #include -- cgit v1.2.3 From 16e2beab9e4d412399f495f6165d27da80cb3675 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 7 May 2009 16:38:32 -0400 Subject: Adapt mail to EShellBackend changes. Again, builds but not tested. Lots of compiler warnings to clean up, but I don't have the energy for it. This was pretty grueling. --- mail/mail-session.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index df5d35c179..5cb61e9f71 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -83,7 +83,7 @@ typedef struct _MailSessionClass { } MailSessionClass; -static EShellModule *mail_shell_module; +static EMailShellBackend *session_mail_shell_backend; static CamelSessionClass *ms_parent_class; static char *get_password(CamelSession *session, CamelService *service, const char *domain, const char *prompt, const char *item, guint32 flags, CamelException *ex); @@ -512,7 +512,7 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException gconf = mail_config_get_gconf_client (); - data_dir = e_shell_module_get_data_dir (mail_shell_module); + data_dir = e_shell_backend_get_data_dir (session_mail_shell_backend); user = g_build_filename (data_dir, "filters.xml", NULL); system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL); fc = (RuleContext *) em_filter_context_new (); @@ -706,16 +706,18 @@ mail_session_check_junk_notify (GConfClient *gconf, guint id, GConfEntry *entry, } void -mail_session_init (EShellModule *shell_module) +mail_session_init (EMailShellBackend *mail_shell_backend) { EShell *shell; + EShellBackend *shell_backend; GConfClient *gconf; gboolean online; const gchar *data_dir; - mail_shell_module = shell_module; + session_mail_shell_backend = mail_shell_backend; - shell = e_shell_module_get_shell (shell_module); + shell_backend = E_SHELL_BACKEND (mail_shell_backend); + shell = e_shell_backend_get_shell (shell_backend); online = e_shell_get_online (shell); data_dir = e_get_user_data_dir (); @@ -728,7 +730,7 @@ mail_session_init (EShellModule *shell_module) e_account_combo_box_set_session (session); /* XXX Don't ask... */ e_account_writable(NULL, E_ACCOUNT_SOURCE_SAVE_PASSWD); /* Init the EAccount Setup */ - data_dir = e_shell_module_get_data_dir (shell_module); + data_dir = e_shell_backend_get_data_dir (shell_backend); camel_session_construct (session, data_dir); gconf = mail_config_get_gconf_client (); -- cgit v1.2.3 From 03fe4bdcbc8a2e644339bbfcd12843da1f766375 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 7 May 2009 21:12:02 -0400 Subject: Fix most of the compiler warnings in mail. --- mail/mail-session.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 5cb61e9f71..c236a144d1 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -503,6 +503,7 @@ session_system_beep (CamelFilterDriver *driver, gpointer user_data) static CamelFilterDriver * main_get_filter_driver (CamelSession *session, const char *type, CamelException *ex) { + EShellBackend *shell_backend; CamelFilterDriver *driver; FilterRule *rule = NULL; const gchar *data_dir; @@ -511,8 +512,9 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException RuleContext *fc; gconf = mail_config_get_gconf_client (); + shell_backend = E_SHELL_BACKEND (session_mail_shell_backend); - data_dir = e_shell_backend_get_data_dir (session_mail_shell_backend); + data_dir = e_shell_backend_get_data_dir (shell_backend); user = g_build_filename (data_dir, "filters.xml", NULL); system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL); fc = (RuleContext *) em_filter_context_new (); -- cgit v1.2.3 From e4afd3f9fb962ea1295a0657ec9f83a427829171 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 26 May 2009 23:21:02 -0400 Subject: Remove trailing whitespace, again. --- mail/mail-session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 03277b4b6f..d9e34ccff4 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -10,7 +10,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see + * License along with the program; if not, see * * * Authors: -- cgit v1.2.3 From 948235c3d1076dbe6ed2e57a24c16a083bbd9f01 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 27 May 2009 10:29:19 -0400 Subject: Prefer GLib basic types over C types. --- mail/mail-session.c | 104 ++++++++++++++++++++++++++-------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index bab6a67729..862b611d15 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -61,7 +61,7 @@ #define d(x) CamelSession *session; -static int session_check_junk_notify_id = -1; +static gint session_check_junk_notify_id = -1; #define MAIL_SESSION_TYPE (mail_session_get_type ()) #define MAIL_SESSION(obj) (CAMEL_CHECK_CAST((obj), MAIL_SESSION_TYPE, MailSession)) @@ -86,16 +86,16 @@ typedef struct _MailSessionClass { static EMailShellBackend *session_mail_shell_backend; static CamelSessionClass *ms_parent_class; -static char *get_password(CamelSession *session, CamelService *service, const char *domain, const char *prompt, const char *item, guint32 flags, CamelException *ex); -static void forget_password(CamelSession *session, CamelService *service, const char *domain, const char *item, CamelException *ex); -static gboolean alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel); -static CamelFilterDriver *get_filter_driver(CamelSession *session, const char *type, CamelException *ex); -static gboolean lookup_addressbook(CamelSession *session, const char *name); +static gchar *get_password(CamelSession *session, CamelService *service, const gchar *domain, const gchar *prompt, const gchar *item, guint32 flags, CamelException *ex); +static void forget_password(CamelSession *session, CamelService *service, const gchar *domain, const gchar *item, CamelException *ex); +static gboolean alert_user(CamelSession *session, CamelSessionAlertType type, const gchar *prompt, gboolean cancel); +static CamelFilterDriver *get_filter_driver(CamelSession *session, const gchar *type, CamelException *ex); +static gboolean lookup_addressbook(CamelSession *session, const gchar *name); -static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc); -static void *ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size); +static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const gchar *text, gint pc); +static gpointer ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, guint size); static void ms_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *m); -static void ms_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex); +static void ms_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const gchar *address, CamelException *ex); static void init (MailSession *session) @@ -152,10 +152,10 @@ mail_session_get_type (void) } -static char * -make_key (CamelService *service, const char *item) +static gchar * +make_key (CamelService *service, const gchar *item) { - char *key; + gchar *key; if (service) key = camel_url_to_string (service->url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS); @@ -167,12 +167,12 @@ make_key (CamelService *service, const char *item) /* ********************************************************************** */ -static char * -get_password (CamelSession *session, CamelService *service, const char *domain, - const char *prompt, const char *item, guint32 flags, CamelException *ex) +static gchar * +get_password (CamelSession *session, CamelService *service, const gchar *domain, + const gchar *prompt, const gchar *item, guint32 flags, CamelException *ex) { - char *url; - char *ret = NULL; + gchar *url; + gchar *ret = NULL; EAccount *account = NULL; url = service?camel_url_to_string(service->url, CAMEL_URL_HIDE_ALL):NULL; @@ -185,7 +185,7 @@ get_password (CamelSession *session, CamelService *service, const char *domain, else ret = g_strdup(url); } else { - char *key = make_key(service, item); + gchar *key = make_key(service, item); EAccountService *config_service = NULL; if (domain == NULL) @@ -206,7 +206,7 @@ get_password (CamelSession *session, CamelService *service, const char *domain, if (!config_service || (config_service && !config_service->get_password_canceled)) { guint32 eflags; - char *title; + gchar *title; if (flags & CAMEL_SESSION_PASSPHRASE) { if (account) @@ -265,9 +265,9 @@ get_password (CamelSession *session, CamelService *service, const char *domain, } static void -forget_password (CamelSession *session, CamelService *service, const char *domain, const char *item, CamelException *ex) +forget_password (CamelSession *session, CamelService *service, const gchar *domain, const gchar *item, CamelException *ex) { - char *key = make_key (service, item); + gchar *key = make_key (service, item); e_passwords_forget_password (domain?domain:"Mail", key); g_free (key); @@ -282,18 +282,18 @@ struct _user_message_msg { MailMsg base; CamelSessionAlertType type; - char *prompt; + gchar *prompt; EFlag *done; - unsigned int allow_cancel:1; - unsigned int result:1; - unsigned int ismain:1; + guint allow_cancel:1; + guint result:1; + guint ismain:1; }; static void user_message_exec (struct _user_message_msg *m); static void -user_message_response_free (GtkDialog *dialog, int button, struct _user_message_msg *m) +user_message_response_free (GtkDialog *dialog, gint button, struct _user_message_msg *m) { gtk_widget_destroy ((GtkWidget *) dialog); @@ -309,7 +309,7 @@ user_message_response_free (GtkDialog *dialog, int button, struct _user_message_ /* clicked, send back the reply */ static void -user_message_response (GtkDialog *dialog, int button, struct _user_message_msg *m) +user_message_response (GtkDialog *dialog, gint button, struct _user_message_msg *m) { /* if !allow_cancel, then we've already replied */ if (m->allow_cancel) { @@ -400,7 +400,7 @@ static MailMsgInfo user_message_info = { }; static gboolean -lookup_addressbook(CamelSession *session, const char *name) +lookup_addressbook(CamelSession *session, const gchar *name) { CamelInternetAddress *addr; gboolean ret; @@ -417,7 +417,7 @@ lookup_addressbook(CamelSession *session, const char *name) } static gboolean -alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel) +alert_user(CamelSession *session, CamelSessionAlertType type, const gchar *prompt, gboolean cancel) { MailSession *mail_session = MAIL_SESSION (session); struct _user_message_msg *m; @@ -454,13 +454,13 @@ alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt } static CamelFolder * -get_folder (CamelFilterDriver *d, const char *uri, void *data, CamelException *ex) +get_folder (CamelFilterDriver *d, const gchar *uri, gpointer data, CamelException *ex) { return mail_tool_uri_to_folder(uri, 0, ex); } static void -main_play_sound (CamelFilterDriver *driver, char *filename, gpointer user_data) +main_play_sound (CamelFilterDriver *driver, gchar *filename, gpointer user_data) { if (filename && *filename) gnome_sound_play (filename); @@ -472,7 +472,7 @@ main_play_sound (CamelFilterDriver *driver, char *filename, gpointer user_data) } static void -session_play_sound (CamelFilterDriver *driver, const char *filename, gpointer user_data) +session_play_sound (CamelFilterDriver *driver, const gchar *filename, gpointer user_data) { MailSession *ms = (MailSession *) session; @@ -501,13 +501,13 @@ session_system_beep (CamelFilterDriver *driver, gpointer user_data) } static CamelFilterDriver * -main_get_filter_driver (CamelSession *session, const char *type, CamelException *ex) +main_get_filter_driver (CamelSession *session, const gchar *type, CamelException *ex) { EShellBackend *shell_backend; CamelFilterDriver *driver; FilterRule *rule = NULL; const gchar *data_dir; - char *user, *system; + gchar *user, *system; GConfClient *gconf; RuleContext *fc; @@ -529,7 +529,7 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException MailSession *ms = (MailSession *) session; if (ms->filter_logfile == NULL) { - char *filename; + gchar *filename; filename = gconf_client_get_string (gconf, "/apps/evolution/mail/filters/logfile", NULL); if (filename) { @@ -585,7 +585,7 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException } static CamelFilterDriver * -get_filter_driver (CamelSession *session, const char *type, CamelException *ex) +get_filter_driver (CamelSession *session, const gchar *type, CamelException *ex) { return (CamelFilterDriver *) mail_call_main (MAIL_CALL_p_ppp, (MailMainFunc) main_get_filter_driver, session, type, ex); @@ -596,7 +596,7 @@ get_filter_driver (CamelSession *session, const char *type, CamelException *ex) static MailMsgInfo ms_thread_info_dummy = { sizeof (MailMsg) }; -static void *ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size) +static gpointer ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, guint size) { CamelSessionThreadMsg *msg = ms_parent_class->thread_msg_new(session, ops, size); @@ -620,14 +620,14 @@ static void ms_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *m) ms_parent_class->thread_msg_free(session, m); } -static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc) +static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const gchar *text, gint pc) { /* This should never be called since we bypass it in alloc! */ printf("Thread status '%s' %d%%\n", text, pc); } static void -ms_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex) +ms_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const gchar *address, CamelException *ex) { g_return_if_fail (session != NULL); g_return_if_fail (message != NULL); @@ -636,12 +636,12 @@ ms_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *mes em_utils_forward_message_raw (folder, message, address, ex); } -char * -mail_session_get_password (const char *url_string) +gchar * +mail_session_get_password (const gchar *url_string) { CamelURL *url; - char *simple_url; - char *passwd; + gchar *simple_url; + gchar *passwd; url = camel_url_new (url_string, NULL); simple_url = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS); @@ -655,11 +655,11 @@ mail_session_get_password (const char *url_string) } void -mail_session_add_password (const char *url_string, - const char *passwd) +mail_session_add_password (const gchar *url_string, + const gchar *passwd) { CamelURL *url; - char *simple_url; + gchar *simple_url; url = camel_url_new (url_string, NULL); simple_url = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS); @@ -671,10 +671,10 @@ mail_session_add_password (const char *url_string, } void -mail_session_remember_password (const char *url_string) +mail_session_remember_password (const gchar *url_string) { CamelURL *url; - char *simple_url; + gchar *simple_url; url = camel_url_new (url_string, NULL); simple_url = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS); @@ -686,7 +686,7 @@ mail_session_remember_password (const char *url_string) } void -mail_session_forget_password (const char *key) +mail_session_forget_password (const gchar *key) { e_passwords_forget_password ("Mail", key); } @@ -796,11 +796,11 @@ mail_session_flush_filter_log (void) } void -mail_session_add_junk_plugin (const char *plugin_name, CamelJunkPlugin *junk_plugin) +mail_session_add_junk_plugin (const gchar *plugin_name, CamelJunkPlugin *junk_plugin) { MailSession *ms = (MailSession *) session; GConfClient *gconf; - char *def_plugin; + gchar *def_plugin; gconf = mail_config_get_gconf_client (); def_plugin = gconf_client_get_string (gconf, "/apps/evolution/mail/junk/default_plugin", NULL); @@ -825,7 +825,7 @@ mail_session_get_junk_plugins (void) } void -mail_session_set_junk_headers (const char **name, const char **value, int len) +mail_session_set_junk_headers (const gchar **name, const gchar **value, gint len) { if (!session) return; -- cgit v1.2.3 From f0d3f3afdfa314e1e8cd7d8da790878008a46aad Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 24 Jun 2009 12:59:33 -0400 Subject: Radically reorganize source code. - Collect all shell modules into a new top-level 'modules' directory: $(top_srcdir)/modules/addressbook $(top_srcdir)/modules/calendar $(top_srcdir)/modules/mail Nothing is allowed to link to these, not plugins nor other modules. THIS SOLVES BUG #571275 AND OPENS THE DOOR TO PORTING TO MAC OS X. - Mimic the libevolution-mail-shared library from master (except drop the "shared" suffix) and have libevolution-mail-importers and all mail-related plugins link to it. - Discard the a11y subdirectories and have the files live alongside their counterpart widgets. --- mail/mail-session.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 862b611d15..bdb5d915c9 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -83,7 +83,7 @@ typedef struct _MailSessionClass { } MailSessionClass; -static EMailShellBackend *session_mail_shell_backend; +static EShellBackend *session_shell_backend; static CamelSessionClass *ms_parent_class; static gchar *get_password(CamelSession *session, CamelService *service, const gchar *domain, const gchar *prompt, const gchar *item, guint32 flags, CamelException *ex); @@ -503,7 +503,6 @@ session_system_beep (CamelFilterDriver *driver, gpointer user_data) static CamelFilterDriver * main_get_filter_driver (CamelSession *session, const gchar *type, CamelException *ex) { - EShellBackend *shell_backend; CamelFilterDriver *driver; FilterRule *rule = NULL; const gchar *data_dir; @@ -512,9 +511,8 @@ main_get_filter_driver (CamelSession *session, const gchar *type, CamelException RuleContext *fc; gconf = mail_config_get_gconf_client (); - shell_backend = E_SHELL_BACKEND (session_mail_shell_backend); - data_dir = e_shell_backend_get_data_dir (shell_backend); + data_dir = e_shell_backend_get_data_dir (session_shell_backend); user = g_build_filename (data_dir, "filters.xml", NULL); system = g_build_filename (EVOLUTION_PRIVDATADIR, "filtertypes.xml", NULL); fc = (RuleContext *) em_filter_context_new (); @@ -708,17 +706,15 @@ mail_session_check_junk_notify (GConfClient *gconf, guint id, GConfEntry *entry, } void -mail_session_init (EMailShellBackend *mail_shell_backend) +mail_session_init (EShellBackend *shell_backend) { EShell *shell; - EShellBackend *shell_backend; GConfClient *gconf; gboolean online; const gchar *data_dir; - session_mail_shell_backend = mail_shell_backend; + session_shell_backend = shell_backend; - shell_backend = E_SHELL_BACKEND (mail_shell_backend); shell = e_shell_backend_get_shell (shell_backend); online = e_shell_get_online (shell); -- cgit v1.2.3 From 374bd42f69aca2e132fd854c9619f3d7491f1f96 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 12 Jul 2009 23:33:07 -0400 Subject: Fix excessive whitespace. --- mail/mail-session.c | 1 - 1 file changed, 1 deletion(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index bdb5d915c9..4bd0a5f78d 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -151,7 +151,6 @@ mail_session_get_type (void) return mail_session_type; } - static gchar * make_key (CamelService *service, const gchar *item) { -- cgit v1.2.3 From ff7084ffe4a935a4cfafc9cd44a9b9daf43cb976 Mon Sep 17 00:00:00 2001 From: "H.Habighorst" Date: Sun, 23 Aug 2009 08:31:14 -0400 Subject: Bug 571488 - Migrate from deprecated gnome_sound to libcanberra --- mail/mail-session.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 4bd0a5f78d..27fdaf9942 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -33,7 +33,7 @@ #include -#include +#include #include #include @@ -462,7 +462,9 @@ static void main_play_sound (CamelFilterDriver *driver, gchar *filename, gpointer user_data) { if (filename && *filename) - gnome_sound_play (filename); + ca_context_play(ca_gtk_context_get(), 0, + CA_PROP_MEDIA_FILENAME, filename, + NULL); else gdk_beep (); -- cgit v1.2.3