diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2008-10-23 00:05:42 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-10-23 00:05:42 +0800 |
commit | 617fe5b5761a66b7d977dbf77a8bf46e79e62f92 (patch) | |
tree | 17c731cc6eaa254ae534a160ec7ca6e33412d1a1 /mail | |
parent | 3b5d0b114c5c36753dc0497f8a027cf1b84a92af (diff) | |
download | gsoc2013-evolution-617fe5b5761a66b7d977dbf77a8bf46e79e62f92.tar gsoc2013-evolution-617fe5b5761a66b7d977dbf77a8bf46e79e62f92.tar.gz gsoc2013-evolution-617fe5b5761a66b7d977dbf77a8bf46e79e62f92.tar.bz2 gsoc2013-evolution-617fe5b5761a66b7d977dbf77a8bf46e79e62f92.tar.lz gsoc2013-evolution-617fe5b5761a66b7d977dbf77a8bf46e79e62f92.tar.xz gsoc2013-evolution-617fe5b5761a66b7d977dbf77a8bf46e79e62f92.tar.zst gsoc2013-evolution-617fe5b5761a66b7d977dbf77a8bf46e79e62f92.zip |
Just some minor code polishing.
2008-10-22 Matthew Barnes <mbarnes@redhat.com>
* mail-send-recv.c:
* mail-send-recv.h:
Just some minor code polishing.
svn path=/trunk/; revision=36676
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/mail-send-recv.c | 28 | ||||
-rw-r--r-- | mail/mail-send-recv.h | 25 |
3 files changed, 33 insertions, 26 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 7a7536b9a7..a5a277b527 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2008-10-22 Matthew Barnes <mbarnes@redhat.com> + + * mail-send-recv.c: + * mail-send-recv.h: + Just some minor code polishing. + 2008-10-21 Sankar P <psankar@novell.com> * em-folder-view.c (emfv_spin): diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 29cbb57322..d2447d76b7 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -105,7 +105,7 @@ struct _send_info { send_info_t type; /* 0 = fetch, 1 = send */ CamelOperation *cancel; char *uri; - int keep; + gboolean keep_on_server; send_state_t state; GtkWidget *progress_bar; GtkWidget *cancel_button; @@ -470,7 +470,7 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati d(printf("adding source %s\n", source->url)); info->uri = g_strdup (source->url); - info->keep = source->keep_on_server; + info->keep_on_server = source->keep_on_server; info->cancel = camel_operation_new (operation_status, info); info->state = SEND_ACTIVE; info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); @@ -552,7 +552,7 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati d(printf("adding dest %s\n", destination)); info->uri = g_strdup (destination); - info->keep = FALSE; + info->keep_on_server = FALSE; info->cancel = camel_operation_new (operation_status, info); info->state = SEND_ACTIVE; info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); @@ -930,7 +930,7 @@ mail_send_receive (void) switch(info->type) { case SEND_RECEIVE: - mail_fetch_mail(info->uri, info->keep, + mail_fetch_mail(info->uri, info->keep_on_server, FILTER_SOURCE_INCOMING, info->cancel, receive_get_folder, info, @@ -971,11 +971,15 @@ auto_timeout(void *data) { struct _auto_data *info = data; - if (camel_session_is_online(session)) { - const char *uri = e_account_get_string(info->account, E_ACCOUNT_SOURCE_URL); - int keep = e_account_get_bool(info->account, E_ACCOUNT_SOURCE_KEEP_ON_SERVER); + if (camel_session_is_online (session)) { + const gchar *uri; + gboolean keep_on_server; - mail_receive_uri(uri, keep); + uri = e_account_get_string ( + info->account, E_ACCOUNT_SOURCE_URL); + keep_on_server = e_account_get_bool ( + info->account, E_ACCOUNT_SOURCE_KEEP_ON_SERVER); + mail_receive_uri (uri, keep_on_server); } return TRUE; @@ -1090,7 +1094,7 @@ mail_autoreceive_init (CamelSession *session) /* we setup the download info's in a hashtable, if we later need to build the gui, we insert them in to add them. */ void -mail_receive_uri (const char *uri, int keep) +mail_receive_uri (const gchar *uri, gboolean keep_on_server) { struct _send_info *info; struct _send_data *data; @@ -1117,7 +1121,7 @@ mail_receive_uri (const char *uri, int keep) info->progress_bar = NULL; info->status_label = NULL; info->uri = g_strdup (uri); - info->keep = keep; + info->keep_on_server = keep_on_server; info->cancel = camel_operation_new (operation_status, info); info->cancel_button = NULL; info->data = data; @@ -1130,7 +1134,7 @@ mail_receive_uri (const char *uri, int keep) switch (info->type) { case SEND_RECEIVE: - mail_fetch_mail (info->uri, info->keep, + mail_fetch_mail (info->uri, info->keep_on_server, FILTER_SOURCE_INCOMING, info->cancel, receive_get_folder, info, @@ -1189,7 +1193,7 @@ mail_send (void) info->progress_bar = NULL; info->status_label = NULL; info->uri = g_strdup (transport->url); - info->keep = FALSE; + info->keep_on_server = FALSE; info->cancel = NULL; info->cancel_button = NULL; info->data = data; diff --git a/mail/mail-send-recv.h b/mail/mail-send-recv.h index 8d8e4bbde2..4fc4e991ec 100644 --- a/mail/mail-send-recv.h +++ b/mail/mail-send-recv.h @@ -24,25 +24,22 @@ #define MAIL_SEND_RECV_H #include <gtk/gtk.h> -#include "mail-config.h" +#include <camel/camel-session.h> -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -struct _CamelSession; +G_BEGIN_DECLS /* send/receive all uri's */ -GtkWidget *mail_send_receive(void); +GtkWidget * mail_send_receive (void); + /* receive a single uri */ -void mail_receive_uri(const char *uri, int keep); -void mail_send (void); +void mail_receive_uri (const gchar *uri, + gboolean keep_on_server); + +void mail_send (void); + /* setup auto receive stuff */ -void mail_autoreceive_init (struct _CamelSession *session); +void mail_autoreceive_init (CamelSession *session); -#ifdef __cplusplus -} -#endif /* __cplusplus */ +G_END_DECLS #endif /* ! MAIL_SEND_RECV_H */ |