aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-07-11 23:31:15 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-07-12 10:25:06 +0800
commiteb29179da623f9cf4abd663577395a085452ca18 (patch)
treea7eec4690f254d4cb9048ca87a5e7f401a2e74ae /mail
parentbeb8e74577f695d0d3c2efea52dc10c2136f0135 (diff)
downloadgsoc2013-evolution-eb29179da623f9cf4abd663577395a085452ca18.tar
gsoc2013-evolution-eb29179da623f9cf4abd663577395a085452ca18.tar.gz
gsoc2013-evolution-eb29179da623f9cf4abd663577395a085452ca18.tar.bz2
gsoc2013-evolution-eb29179da623f9cf4abd663577395a085452ca18.tar.lz
gsoc2013-evolution-eb29179da623f9cf4abd663577395a085452ca18.tar.xz
gsoc2013-evolution-eb29179da623f9cf4abd663577395a085452ca18.tar.zst
gsoc2013-evolution-eb29179da623f9cf4abd663577395a085452ca18.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'mail')
-rw-r--r--mail/mail-folder-cache.c80
-rw-r--r--mail/mail-session.c2
-rw-r--r--mail/mail-tools.c26
-rw-r--r--mail/message-list.c8
4 files changed, 80 insertions, 36 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index d4c4e523f3..c9493c8d1b 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -181,8 +181,10 @@ real_flush_updates (gpointer o, gpointer event_data, gpointer data)
/* indicate that the folder has changed (new mail received, etc) */
if (up->uri) {
- g_signal_emit (self, signals[FOLDER_CHANGED], 0, up->store,
- up->uri, up->full_name, up->new, up->msg_uid, up->msg_sender, up->msg_subject);
+ g_signal_emit (
+ self, signals[FOLDER_CHANGED], 0, up->store,
+ up->uri, up->full_name, up->new, up->msg_uid,
+ up->msg_sender, up->msg_subject);
}
if (CAMEL_IS_VEE_STORE (up->store) && !up->remove) {
@@ -239,7 +241,13 @@ flush_updates (MailFolderCache *self)
* it's correct. */
static void
-update_1folder(MailFolderCache *self, struct _folder_info *mfi, gint new, const gchar *msg_uid, const gchar *msg_sender, const gchar *msg_subject, CamelFolderInfo *info)
+update_1folder (MailFolderCache *self,
+ struct _folder_info *mfi,
+ gint new,
+ const gchar *msg_uid,
+ const gchar *msg_sender,
+ const gchar *msg_subject,
+ CamelFolderInfo *info)
{
struct _folder_update *up;
CamelFolder *folder;
@@ -252,9 +260,12 @@ update_1folder(MailFolderCache *self, struct _folder_info *mfi, gint new, const
d(printf("update 1 folder '%s'\n", folder->full_name));
if ((self->priv->count_trash && (CAMEL_IS_VTRASH_FOLDER (folder)))
- || (is_drafts = em_utils_folder_is_drafts (folder, info ? info->uri : NULL))
- || (is_outbox = em_utils_folder_is_outbox (folder, info ? info->uri : NULL))
- || (self->priv->count_sent && em_utils_folder_is_sent (folder, info ? info->uri : NULL))) {
+ || (is_drafts = em_utils_folder_is_drafts (
+ folder, info ? info->uri : NULL))
+ || (is_outbox = em_utils_folder_is_outbox (
+ folder, info ? info->uri : NULL))
+ || (self->priv->count_sent && em_utils_folder_is_sent (
+ folder, info ? info->uri : NULL))) {
d(printf(" total count\n"));
unread = camel_folder_get_message_count (folder);
if (is_drafts || is_outbox) {
@@ -323,7 +334,8 @@ folder_changed_cb (CamelFolder *folder,
last_newmail_per_folder = g_hash_table_new (g_direct_hash, g_direct_equal);
/* it's fine to hash them by folder pointer here */
- latest_received = GPOINTER_TO_INT (g_hash_table_lookup (last_newmail_per_folder, folder));
+ latest_received = GPOINTER_TO_INT (
+ g_hash_table_lookup (last_newmail_per_folder, folder));
local_drafts = e_mail_local_get_folder (E_MAIL_FOLDER_DRAFTS);
local_outbox = e_mail_local_get_folder (E_MAIL_FOLDER_OUTBOX);
@@ -366,7 +378,9 @@ folder_changed_cb (CamelFolder *folder,
}
if (new > 0)
- g_hash_table_insert (last_newmail_per_folder, folder, GINT_TO_POINTER (latest_received));
+ g_hash_table_insert (
+ last_newmail_per_folder, folder,
+ GINT_TO_POINTER (latest_received));
g_mutex_lock (self->priv->stores_mutex);
if (self->priv->stores != NULL
@@ -383,7 +397,10 @@ folder_changed_cb (CamelFolder *folder,
}
static void
-unset_folder_info(MailFolderCache *self, struct _folder_info *mfi, gint delete, gint unsub)
+unset_folder_info (MailFolderCache *self,
+ struct _folder_info *mfi,
+ gint delete,
+ gint unsub)
{
struct _folder_update *up;
@@ -561,7 +578,11 @@ folder_to_url(CamelStore *store, const gchar *full_name)
}
static void
-rename_folders(MailFolderCache *self, struct _store_info *si, const gchar *oldbase, const gchar *newbase, CamelFolderInfo *fi)
+rename_folders (MailFolderCache *self,
+ struct _store_info *si,
+ const gchar *oldbase,
+ const gchar *newbase,
+ CamelFolderInfo *fi)
{
gchar *old, *olduri, *oldfile, *newuri, *newfile;
struct _folder_info *mfi;
@@ -772,10 +793,12 @@ ping_store_exec (struct _ping_store_msg *m)
if (CAMEL_SERVICE (m->store)->status == CAMEL_SERVICE_CONNECTED) {
if (CAMEL_IS_DISCO_STORE (m->store) &&
- camel_disco_store_status (CAMEL_DISCO_STORE (m->store)) != CAMEL_DISCO_STORE_OFFLINE)
+ camel_disco_store_status (
+ CAMEL_DISCO_STORE (m->store)) !=CAMEL_DISCO_STORE_OFFLINE)
online = TRUE;
else if (CAMEL_IS_OFFLINE_STORE (m->store) &&
- CAMEL_OFFLINE_STORE (m->store)->state != CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
+ CAMEL_OFFLINE_STORE (m->store)->state !=
+ CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
online = TRUE;
}
if (online)
@@ -854,7 +877,8 @@ storeinfo_find_folder_info (CamelStore *store,
struct _find_info *fi)
{
if (fi->fi == NULL) {
- if (((CamelService *)store)->provider->url_equal(fi->url, ((CamelService *)store)->url)) {
+ if (((CamelService *)store)->provider->url_equal (
+ fi->url, ((CamelService *)store)->url)) {
gchar *path = fi->url->fragment?fi->url->fragment:fi->url->path;
if (path[0] == '/')
@@ -1077,12 +1101,13 @@ mail_folder_cache_note_store (MailFolderCache *self,
si = g_hash_table_lookup (self->priv->stores, store);
if (si == NULL) {
- d(printf("Noting a new store: %p: %s\n", store, camel_url_to_string(((CamelService *)store)->url, 0)));
-
si = g_malloc0(sizeof(*si));
si->folders = g_hash_table_new(g_str_hash, g_str_equal);
- si->folders_uri = g_hash_table_new(CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->hash_folder_name,
- CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name);
+ si->folders_uri = g_hash_table_new (
+ CAMEL_STORE_CLASS (
+ CAMEL_OBJECT_GET_CLASS(store))->hash_folder_name,
+ CAMEL_STORE_CLASS (
+ CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name);
si->store = g_object_ref (store);
g_hash_table_insert(self->priv->stores, store, si);
g_queue_init (&si->folderinfo_updates);
@@ -1095,18 +1120,22 @@ mail_folder_cache_note_store (MailFolderCache *self,
ud->cancel = 0;
ud->cache = self;
- /* We might get a race when setting up a store, such that it is still left in offline mode,
- after we've gone online. This catches and fixes it up when the shell opens us */
+ /* We might get a race when setting up a store, such that it is
+ * still left in offline mode, after we've gone online. This
+ * catches and fixes it up when the shell opens us. */
if (CAMEL_IS_DISCO_STORE (store)) {
- if (camel_session_get_online (session)
- && camel_disco_store_status (CAMEL_DISCO_STORE (store)) == CAMEL_DISCO_STORE_OFFLINE) {
+ if (camel_session_get_online (session) &&
+ camel_disco_store_status (CAMEL_DISCO_STORE (store)) ==
+ CAMEL_DISCO_STORE_OFFLINE) {
/* Note: we use the 'id' here, even though its not the right id, its still ok */
ud->id = mail_store_set_offline (store, FALSE, store_online_cb, ud);
} else {
goto normal_setup;
}
} else if (CAMEL_IS_OFFLINE_STORE (store)) {
- if (camel_session_get_online (session) && CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
+ if (camel_session_get_online (session) &&
+ CAMEL_OFFLINE_STORE (store)->state ==
+ CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
/* Note: we use the 'id' here, even though its not the right id, its still ok */
ud->id = mail_store_set_offline (store, FALSE, store_online_cb, ud);
} else {
@@ -1121,7 +1150,8 @@ mail_folder_cache_note_store (MailFolderCache *self,
g_mutex_unlock (self->priv->stores_mutex);
- /* there is potential for race here, but it is safe as we check for the store anyway */
+ /* there is potential for race here, but it is safe as we check
+ * for the store anyway */
if (hook) {
g_signal_connect (
store, "folder-opened",
@@ -1316,7 +1346,9 @@ mail_folder_cache_get_folder_info_flags (MailFolderCache *self,
/* Returns whether folder 'folder' has children based on folder_info->child property.
If not found returns FALSE and sets 'found' to FALSE, if not NULL. */
gboolean
-mail_folder_cache_get_folder_has_children (MailFolderCache *self, CamelFolder *folder, gboolean *found)
+mail_folder_cache_get_folder_has_children (MailFolderCache *self,
+ CamelFolder *folder,
+ gboolean *found)
{
gchar *uri = mail_tools_folder_to_url (folder);
struct _find_info fi = { uri, NULL, NULL };
diff --git a/mail/mail-session.c b/mail/mail-session.c
index e2da6389f1..1ccb87cbca 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -853,7 +853,7 @@ mail_session_check_junk_notify (GConfClient *gconf, guint id, GConfEntry *entry,
key = strrchr (gconf_entry_get_key (entry), '/');
if (key) {
- key ++;
+ key++;
if (!strcmp (key, "check_incoming"))
camel_session_set_check_junk (session, gconf_value_get_bool (gconf_entry_get_value (entry)));
}
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 22dfb54e22..25eaac5f44 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -74,7 +74,9 @@ is_local_provider (CamelStore *store)
}
CamelFolder *
-mail_tool_get_trash (const gchar *url, gint connect, GError **error)
+mail_tool_get_trash (const gchar *url,
+ gint connect,
+ GError **error)
{
CamelStore *store;
CamelFolder *trash;
@@ -88,7 +90,9 @@ mail_tool_get_trash (const gchar *url, gint connect, GError **error)
if (!store)
return NULL;
- if (connect || ((CamelService *) store)->status == CAMEL_SERVICE_CONNECTED || is_local_provider (store))
+ if (connect ||
+ (CAMEL_SERVICE (store)->status == CAMEL_SERVICE_CONNECTED ||
+ is_local_provider (store)))
trash = camel_store_get_trash (store, error);
else
trash = NULL;
@@ -101,7 +105,8 @@ mail_tool_get_trash (const gchar *url, gint connect, GError **error)
#ifndef G_OS_WIN32
static gchar *
-mail_tool_get_local_movemail_path (const guchar *uri, GError **error)
+mail_tool_get_local_movemail_path (const guchar *uri,
+ GError **error)
{
guchar *safe_uri, *c;
const gchar *data_dir;
@@ -244,10 +249,15 @@ mail_tool_remove_xevolution_headers (CamelMimeMessage *message)
}
void
-mail_tool_restore_xevolution_headers (CamelMimeMessage *message, struct _camel_header_raw *xev)
+mail_tool_restore_xevolution_headers (CamelMimeMessage *message,
+ struct _camel_header_raw *xev)
{
+ CamelMedium *medium;
+
+ medium = CAMEL_MEDIUM (message);
+
for (;xev;xev=xev->next)
- camel_medium_add_header((CamelMedium *)message, xev->name, xev->value);
+ camel_medium_add_header (medium, xev->name, xev->value);
}
CamelMimePart *
@@ -397,6 +407,7 @@ mail_tools_x_evolution_message_parse (gchar *in, guint inlen, GPtrArray **uids)
gchar *
mail_tools_folder_to_url (CamelFolder *folder)
{
+ CamelService *service;
CamelStore *parent_store;
const gchar *full_name;
CamelURL *url;
@@ -406,9 +417,10 @@ mail_tools_folder_to_url (CamelFolder *folder)
full_name = camel_folder_get_full_name (folder);
parent_store = camel_folder_get_parent_store (folder);
+ service = CAMEL_SERVICE (parent_store);
- url = camel_url_copy(((CamelService *)parent_store)->url);
- if (((CamelService *)parent_store)->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) {
+ url = camel_url_copy (service->url);
+ if (service->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) {
camel_url_set_fragment(url, full_name);
} else {
gchar *name = g_alloca(strlen(full_name)+2);
diff --git a/mail/message-list.c b/mail/message-list.c
index 5388163307..969412de4b 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -526,7 +526,7 @@ ml_search_forward(MessageList *ml, gint start, gint end, guint32 flags, guint32
etta = e_tree_get_table_adapter (E_TREE (ml));
- for (row = start; row <= end; row ++) {
+ for (row = start; row <= end; row++) {
path = e_tree_table_adapter_node_at_row(etta, row);
if (path
&& (info = get_message_info(ml, path))
@@ -547,7 +547,7 @@ ml_search_backward(MessageList *ml, gint start, gint end, guint32 flags, guint32
etta = e_tree_get_table_adapter (E_TREE (ml));
- for (row = start; row >= end; row --) {
+ for (row = start; row >= end; row--) {
path = e_tree_table_adapter_node_at_row(etta, row);
if (path
&& (info = get_message_info(ml, path))
@@ -3002,7 +3002,7 @@ find_next_selectable (MessageList *ml)
info = get_message_info (ml, node);
if (info && is_node_selectable (ml, info))
return g_strdup (camel_message_info_uid (info));
- vrow ++;
+ vrow++;
}
/* We didn't find any undeleted entries _below_ the currently selected one
@@ -3014,7 +3014,7 @@ find_next_selectable (MessageList *ml)
info = get_message_info (ml, node);
if (info && is_node_selectable (ml, info))
return g_strdup (camel_message_info_uid (info));
- vrow --;
+ vrow--;
}
return NULL;