aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-02-08 01:36:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-02-08 02:26:37 +0800
commit49ef32b76c55cbefba53568f02028dddf23a9bc9 (patch)
tree682e825cab580d4c401f0a138ee29a8534336591 /mail
parent2ef43b4cf40d21c61d39c5a938e428afa9074e2b (diff)
downloadgsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar
gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.gz
gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.bz2
gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.lz
gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.xz
gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.tar.zst
gsoc2013-evolution-49ef32b76c55cbefba53568f02028dddf23a9bc9.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'mail')
-rw-r--r--mail/em-folder-tree.h3
-rw-r--r--mail/em-vfolder-context.c53
-rw-r--r--mail/em-vfolder-editor.c4
-rw-r--r--mail/mail-mt.c53
4 files changed, 70 insertions, 43 deletions
diff --git a/mail/em-folder-tree.h b/mail/em-folder-tree.h
index a5722e178e..273a87aedf 100644
--- a/mail/em-folder-tree.h
+++ b/mail/em-folder-tree.h
@@ -55,7 +55,8 @@ typedef struct _EMFolderTreePrivate EMFolderTreePrivate;
#define STATE_KEY_EXPANDED "Expanded"
-/* not sure this api is the best, but its the easiest to implement and will cover what we need */
+/* XXX Not sure this api is the best, but its the easiest
+ * to implement and will cover what we need. */
#define EMFT_EXCLUDE_NOSELECT CAMEL_FOLDER_NOSELECT
#define EMFT_EXCLUDE_NOINFERIORS CAMEL_FOLDER_NOINFERIORS
#define EMFT_EXCLUDE_VIRTUAL CAMEL_FOLDER_VIRTUAL
diff --git a/mail/em-vfolder-context.c b/mail/em-vfolder-context.c
index 789735683c..03ecd3681f 100644
--- a/mail/em-vfolder-context.c
+++ b/mail/em-vfolder-context.c
@@ -40,30 +40,26 @@ static EFilterElement *vfolder_new_element(ERuleContext *rc, const gchar *type);
static ERuleContextClass *parent_class = NULL;
static void
-em_vfolder_context_finalise(GObject *obj)
-{
- G_OBJECT_CLASS(parent_class)->finalize(obj);
-}
-
-static void
-em_vfolder_context_class_init(EMVFolderContextClass *klass)
+em_vfolder_context_class_init (EMVFolderContextClass *klass)
{
parent_class = g_type_class_ref(E_TYPE_RULE_CONTEXT);
- ((GObjectClass *)klass)->finalize = em_vfolder_context_finalise;
((ERuleContextClass *)klass)->new_element = vfolder_new_element;
}
static void
-em_vfolder_context_init(EMVFolderContext *vc)
+em_vfolder_context_init (EMVFolderContext *vc)
{
- e_rule_context_add_part_set((ERuleContext *) vc, "partset", E_TYPE_FILTER_PART,
- e_rule_context_add_part, e_rule_context_next_part);
+ e_rule_context_add_part_set (
+ (ERuleContext *) vc, "partset", E_TYPE_FILTER_PART,
+ e_rule_context_add_part, e_rule_context_next_part);
- e_rule_context_add_rule_set((ERuleContext *) vc, "ruleset", em_vfolder_rule_get_type(),
- e_rule_context_add_rule, e_rule_context_next_rule);
+ e_rule_context_add_rule_set (
+ (ERuleContext *) vc, "ruleset", em_vfolder_rule_get_type(),
+ e_rule_context_add_rule, e_rule_context_next_rule);
- ((ERuleContext *)vc)->flags = E_RULE_CONTEXT_THREADING | E_RULE_CONTEXT_GROUPING;
+ ((ERuleContext *)vc)->flags =
+ E_RULE_CONTEXT_THREADING | E_RULE_CONTEXT_GROUPING;
}
GType
@@ -71,20 +67,23 @@ em_vfolder_context_get_type(void)
{
static GType type = 0;
- if (!type) {
- static const GTypeInfo info = {
- sizeof(EMVFolderContextClass),
- NULL, /* base_class_init */
- NULL, /* base_class_finalize */
+ if (G_UNLIKELY (type == 0)) {
+ static const GTypeInfo type_info = {
+ sizeof (EMVFolderContextClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
(GClassInitFunc) em_vfolder_context_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof(EMVFolderContext),
- 0, /* n_preallocs */
+ (GClassFinalizeFunc) NULL,
+ NULL, /* class_data */
+ sizeof (EMVFolderContext),
+ 0, /* n_preallocs */
(GInstanceInitFunc) em_vfolder_context_init,
+ NULL /* value_table */
};
- type = g_type_register_static(E_TYPE_RULE_CONTEXT, "EMVFolderContext", &info, 0);
+ type = g_type_register_static (
+ E_TYPE_RULE_CONTEXT, "EMVFolderContext",
+ &type_info, 0);
}
return type;
@@ -98,13 +97,13 @@ em_vfolder_context_get_type(void)
* Return value: A new #EMVFolderContext object.
**/
EMVFolderContext *
-em_vfolder_context_new(void)
+em_vfolder_context_new (void)
{
- return (EMVFolderContext *)g_object_new(em_vfolder_context_get_type(), NULL, NULL);
+ return g_object_new (em_vfolder_context_get_type(), NULL, NULL);
}
static EFilterElement *
-vfolder_new_element(ERuleContext *rc, const gchar *type)
+vfolder_new_element (ERuleContext *rc, const gchar *type)
{
if (!strcmp(type, "system-flag")) {
return (EFilterElement *) e_filter_option_new();
diff --git a/mail/em-vfolder-editor.c b/mail/em-vfolder-editor.c
index 1a928acf39..192319ce10 100644
--- a/mail/em-vfolder-editor.c
+++ b/mail/em-vfolder-editor.c
@@ -121,7 +121,9 @@ em_vfolder_editor_new (EMVFolderContext *vc)
builder = gtk_builder_new ();
e_load_ui_builder_definition (builder, "filter.ui");
- e_rule_editor_construct ((ERuleEditor *) ve, (ERuleContext *) vc, builder, "incoming", _("Search _Folders"));
+ e_rule_editor_construct (
+ (ERuleEditor *) ve, (ERuleContext *) vc,
+ builder, "incoming", _("Search _Folders"));
gtk_widget_hide (e_builder_get_widget (builder, "label17"));
gtk_widget_hide (e_builder_get_widget (builder, "filter_source_combobox"));
g_object_unref (builder);
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index 4c7c049745..63bde58665 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -43,19 +43,25 @@
* to rework or get rid of the functions that use this. */
const gchar *shell_builtin_backend = "mail";
-static void mail_operation_status(CamelOperation *op, const gchar *what, gint pc, gpointer data);
+static void mail_operation_status (CamelOperation *op,
+ const gchar *what,
+ gint pc,
+ gpointer data);
/* background operation status stuff */
struct _MailMsgPrivate {
- gint activity_state; /* sigh sigh sigh, we need to keep track of the state external to the
- pointer itself for locking/race conditions */
+ /* XXX We need to keep track of the state external to the
+ * pointer itself for locking/race conditions. */
+ gint activity_state;
EActivity *activity;
GtkWidget *error;
gboolean cancelable;
};
static guint mail_msg_seq; /* sequence number of each message */
-static GHashTable *mail_msg_active_table; /* table of active messages, must hold mail_msg_lock to access */
+
+/* Table of active messages. Must hold mail_msg_lock to access. */
+static GHashTable *mail_msg_active_table;
static GMutex *mail_msg_lock;
static GCond *mail_msg_cond;
@@ -255,7 +261,9 @@ mail_msg_check_error (gpointer msg)
/* we key on the operation pointer, which is at least accurate enough
for the operation type, although it could be on a different object. */
if (g_hash_table_lookup(active_errors, m->info)) {
- g_message("Error occurred while existing dialogue active:\n%s", camel_exception_get_description(&m->ex));
+ g_message (
+ "Error occurred while existing dialogue active:\n%s",
+ camel_exception_get_description(&m->ex));
return;
}
@@ -263,10 +271,14 @@ mail_msg_check_error (gpointer msg)
if (m->info->desc
&& (what = m->info->desc (m))) {
- gd = (GtkDialog *)e_alert_dialog_new_for_args (parent, "mail:async-error", what, camel_exception_get_description(&m->ex), NULL);
+ gd = (GtkDialog *) e_alert_dialog_new_for_args (
+ parent, "mail:async-error", what,
+ camel_exception_get_description(&m->ex), NULL);
g_free(what);
} else
- gd = (GtkDialog *)e_alert_dialog_new_for_args (parent, "mail:async-error-nodescribe", camel_exception_get_description(&m->ex), NULL);
+ gd = (GtkDialog *) e_alert_dialog_new_for_args (
+ parent, "mail:async-error-nodescribe",
+ camel_exception_get_description(&m->ex), NULL);
g_hash_table_insert(active_errors, m->info, gd);
g_signal_connect(gd, "response", G_CALLBACK(error_response), m->info);
@@ -632,7 +644,8 @@ static MailMsgInfo async_event_info = {
(MailMsgFreeFunc) NULL
};
-MailAsyncEvent *mail_async_event_new(void)
+MailAsyncEvent *
+mail_async_event_new (void)
{
MailAsyncEvent *ea;
@@ -642,12 +655,19 @@ MailAsyncEvent *mail_async_event_new(void)
return ea;
}
-gint mail_async_event_emit(MailAsyncEvent *ea, mail_async_event_t type, MailAsyncFunc func, gpointer o, gpointer event_data, gpointer data)
+gint
+mail_async_event_emit (MailAsyncEvent *ea,
+ mail_async_event_t type,
+ MailAsyncFunc func,
+ gpointer o,
+ gpointer event_data,
+ gpointer data)
{
struct _proxy_msg *m;
gint id;
- /* we dont have a reply port for this, we dont care when/if it gets executed, just queue it */
+ /* We dont have a reply port for this, we dont
+ * care when/if it gets executed, just queue it. */
m = mail_msg_new(&async_event_info);
m->func = func;
m->o = o;
@@ -662,8 +682,9 @@ gint mail_async_event_emit(MailAsyncEvent *ea, mail_async_event_t type, MailAsyn
ea->tasks = g_slist_prepend(ea->tasks, m);
g_mutex_unlock(ea->lock);
- /* We use an idle function instead of our own message port only because the
- gui message ports's notification buffer might overflow and deadlock us */
+ /* We use an idle function instead of our own message port only
+ * because the gui message ports's notification buffer might
+ * overflow and deadlock us. */
if (type == MAIL_ASYNC_GUI) {
if (mail_in_main_thread ())
g_idle_add(idle_async_event, m);
@@ -675,7 +696,8 @@ gint mail_async_event_emit(MailAsyncEvent *ea, mail_async_event_t type, MailAsyn
return id;
}
-gint mail_async_event_destroy(MailAsyncEvent *ea)
+gint
+mail_async_event_destroy (MailAsyncEvent *ea)
{
gint id;
struct _proxy_msg *m;
@@ -940,7 +962,10 @@ static MailMsgInfo op_status_info = {
};
static void
-mail_operation_status (CamelOperation *op, const gchar *what, gint pc, gpointer data)
+mail_operation_status (CamelOperation *op,
+ const gchar *what,
+ gint pc,
+ gpointer data)
{
struct _op_status_msg *m;