aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-session.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-27 23:13:25 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-29 00:13:23 +0800
commitfad4af8a3d4c6f50f7bcceca8d545eb17d6fd056 (patch)
treeae78be371695c3dc18847b87d3f014f985aa3a40 /mail/mail-session.c
parent6f5464f34ceec9e5701e3e3e651a40f9e6b3a072 (diff)
downloadgsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.gz
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.bz2
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.lz
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.xz
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.tar.zst
gsoc2013-evolution-fad4af8a3d4c6f50f7bcceca8d545eb17d6fd056.zip
Prefer GLib basic types over C types.
Diffstat (limited to 'mail/mail-session.c')
-rw-r--r--mail/mail-session.c112
1 files changed, 56 insertions, 56 deletions
diff --git a/mail/mail-session.c b/mail/mail-session.c
index d9e34ccff4..96b4edf574 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -60,7 +60,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))
@@ -84,16 +84,16 @@ typedef struct _MailSessionClass {
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)
@@ -150,10 +150,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);
@@ -165,12 +165,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;
@@ -183,7 +183,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)
@@ -204,7 +204,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)
@@ -263,9 +263,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);
@@ -280,18 +280,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);
@@ -307,7 +307,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) {
@@ -398,7 +398,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;
@@ -415,7 +415,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;
@@ -452,13 +452,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);
@@ -470,7 +470,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;
@@ -499,11 +499,11 @@ 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)
{
CamelFilterDriver *driver;
FilterRule *rule = NULL;
- char *user, *system;
+ gchar *user, *system;
GConfClient *gconf;
RuleContext *fc;
@@ -523,7 +523,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) {
@@ -579,7 +579,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);
@@ -590,7 +590,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);
@@ -614,14 +614,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);
@@ -630,12 +630,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);
@@ -649,11 +649,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);
@@ -665,10 +665,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);
@@ -680,7 +680,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);
}
@@ -702,9 +702,9 @@ mail_session_check_junk_notify (GConfClient *gconf, guint id, GConfEntry *entry,
}
void
-mail_session_init (const char *base_directory)
+mail_session_init (const gchar *base_directory)
{
- char *camel_dir;
+ gchar *camel_dir;
GConfClient *gconf;
if (camel_init (base_directory, TRUE) != 0)
@@ -773,8 +773,8 @@ mail_session_set_interactive (gboolean interactive)
}
void
-mail_session_forget_passwords (BonoboUIComponent *uih, void *user_data,
- const char *path)
+mail_session_forget_passwords (BonoboUIComponent *uih, gpointer user_data,
+ const gchar *path)
{
e_passwords_forget_passwords ();
}
@@ -789,11 +789,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);
@@ -818,7 +818,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;