From fcbbdfbd18e15b4ee8322a0217cf03a689a5e033 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 16 Aug 2011 11:25:56 -0400 Subject: Coding style and whitespace cleanup. --- filter/e-filter-code.c | 3 ++- filter/e-filter-color.c | 3 ++- filter/e-filter-datespec.c | 28 +++++++++++++++------------ filter/e-filter-input.c | 5 +++-- filter/e-filter-part.c | 4 ++-- filter/e-filter-rule.c | 16 +++++++++------- filter/e-rule-context.c | 6 +++--- filter/e-rule-editor.c | 48 ++++++++++++++++++++++++++++++++-------------- 8 files changed, 71 insertions(+), 42 deletions(-) (limited to 'filter') diff --git a/filter/e-filter-code.c b/filter/e-filter-code.c index 02d8c0cccf..0476f0678c 100644 --- a/filter/e-filter-code.c +++ b/filter/e-filter-code.c @@ -26,6 +26,7 @@ #endif #include "e-filter-code.h" +#include "e-filter-part.h" G_DEFINE_TYPE ( EFilterCode, @@ -36,7 +37,7 @@ G_DEFINE_TYPE ( static void filter_code_build_code (EFilterElement *element, GString *out, - struct _EFilterPart *part) + EFilterPart *part) { GList *l; EFilterInput *fi = (EFilterInput *) element; diff --git a/filter/e-filter-color.c b/filter/e-filter-color.c index 64272d8f30..bf80fbb778 100644 --- a/filter/e-filter-color.c +++ b/filter/e-filter-color.c @@ -36,7 +36,8 @@ G_DEFINE_TYPE ( E_TYPE_FILTER_ELEMENT) static void -set_color (GtkColorButton *color_button, EFilterColor *fc) +set_color (GtkColorButton *color_button, + EFilterColor *fc) { gtk_color_button_get_color (color_button, &fc->color); } diff --git a/filter/e-filter-datespec.c b/filter/e-filter-datespec.c index a7c2aa2f61..ef264d6205 100644 --- a/filter/e-filter-datespec.c +++ b/filter/e-filter-datespec.c @@ -109,7 +109,7 @@ get_best_span (time_t val) { gint i; - for (i=G_N_ELEMENTS (timespans)-1;i>=0;i--) { + for (i = G_N_ELEMENTS (timespans) - 1; i >= 0; i--) { if (val % timespans[i].seconds == 0) return i; } @@ -205,7 +205,7 @@ set_values (EFilterDatespec *fds) EFilterDatespecPrivate *p = fds->priv; - p->type = fds->type==FDST_UNKNOWN ? FDST_NOW : fds->type; + p->type = fds->type == FDST_UNKNOWN ? FDST_NOW : fds->type; note_type = p->type==FDST_X_FUTURE ? FDST_X_AGO : p->type; /* FUTURE and AGO use the same notebook pages/etc. */ @@ -219,43 +219,46 @@ set_values (EFilterDatespec *fds) struct tm tm; localtime_r (&fds->value, &tm); - gtk_calendar_select_month ((GtkCalendar*) p->calendar_specify, tm.tm_mon, tm.tm_year + 1900); - gtk_calendar_select_day ((GtkCalendar*) p->calendar_specify, tm.tm_mday); + gtk_calendar_select_month ((GtkCalendar *) p->calendar_specify, tm.tm_mon, tm.tm_year + 1900); + gtk_calendar_select_day ((GtkCalendar *) p->calendar_specify, tm.tm_mday); break; } case FDST_X_AGO: p->span = get_best_span (fds->value); - gtk_spin_button_set_value ((GtkSpinButton*) p->spin_relative, fds->value/timespans[p->span].seconds); + gtk_spin_button_set_value ((GtkSpinButton *) p->spin_relative, fds->value / timespans[p->span].seconds); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 0); break; case FDST_X_FUTURE: p->span = get_best_span (fds->value); - gtk_spin_button_set_value ((GtkSpinButton*) p->spin_relative, fds->value/timespans[p->span].seconds); + gtk_spin_button_set_value ((GtkSpinButton *) p->spin_relative, fds->value / timespans[p->span].seconds); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 1); break; } - gtk_notebook_set_current_page ((GtkNotebook*) p->notebook_type, note_type); + gtk_notebook_set_current_page ((GtkNotebook *) p->notebook_type, note_type); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_type), note_type); } static void -set_combobox_type (GtkComboBox *combobox, EFilterDatespec *fds) +set_combobox_type (GtkComboBox *combobox, + EFilterDatespec *fds) { fds->priv->type = gtk_combo_box_get_active (combobox); - gtk_notebook_set_current_page ((GtkNotebook*) fds->priv->notebook_type, fds->priv->type); + gtk_notebook_set_current_page ((GtkNotebook *) fds->priv->notebook_type, fds->priv->type); } static void -set_combobox_relative (GtkComboBox *combobox, EFilterDatespec *fds) +set_combobox_relative (GtkComboBox *combobox, + EFilterDatespec *fds) { fds->priv->span = gtk_combo_box_get_active (combobox); } static void -set_combobox_past_future (GtkComboBox *combobox, EFilterDatespec *fds) +set_combobox_past_future (GtkComboBox *combobox, + EFilterDatespec *fds) { if (gtk_combo_box_get_active (combobox) == 0) fds->type = fds->priv->type = FDST_X_AGO; @@ -264,7 +267,8 @@ set_combobox_past_future (GtkComboBox *combobox, EFilterDatespec *fds) } static void -button_clicked (GtkButton *button, EFilterDatespec *fds) +button_clicked (GtkButton *button, + EFilterDatespec *fds) { EFilterDatespecPrivate *p = fds->priv; GtkWidget *content_area; diff --git a/filter/e-filter-input.c b/filter/e-filter-input.c index 9842a5d5ea..10fa1f1765 100644 --- a/filter/e-filter-input.c +++ b/filter/e-filter-input.c @@ -96,7 +96,7 @@ filter_input_validate (EFilterElement *element, gchar *regmsg; /* regerror gets called twice to get the full error string - length to do proper posix error reporting */ + * length to do proper posix error reporting */ reglen = regerror (regerr, ®expat, 0, 0); regmsg = g_malloc0 (reglen + 1); regerror (regerr, ®expat, regmsg, reglen); @@ -178,7 +178,8 @@ filter_input_xml_encode (EFilterElement *element) } static gint -filter_input_xml_decode (EFilterElement *element, xmlNodePtr node) +filter_input_xml_decode (EFilterElement *element, + xmlNodePtr node) { EFilterInput *input = (EFilterInput *) element; gchar *name, *str, *type; diff --git a/filter/e-filter-part.c b/filter/e-filter-part.c index 521c0781aa..0b31097d7c 100644 --- a/filter/e-filter-part.c +++ b/filter/e-filter-part.c @@ -280,7 +280,7 @@ e_filter_part_copy_values (EFilterPart *dst_part, /* NOTE: we go backwards, it just works better that way */ /* for each source type, search the dest type for - a matching type in the same order */ + * a matching type in the same order */ src_link = g_list_last (src_part->elements); dst_link = g_list_last (dst_part->elements); @@ -491,7 +491,7 @@ e_filter_part_expand_code (EFilterPart *part, namelen = (len + 1) * 2; name = g_alloca (namelen); } - memcpy (name, newstart+2, len); + memcpy (name, newstart + 2, len); name[len] = 0; element = e_filter_part_find_element (part, name); diff --git a/filter/e-filter-rule.c b/filter/e-filter-rule.c index aa4d641270..f40f3b3d07 100644 --- a/filter/e-filter-rule.c +++ b/filter/e-filter-rule.c @@ -105,7 +105,7 @@ part_combobox_changed (GtkComboBox *combobox, return; /* here we do a widget shuffle, throw away the old widget/rulepart, - and create another */ + * and create another */ if (data->partwidget) gtk_container_remove (GTK_CONTAINER (data->container), data->partwidget); @@ -203,7 +203,8 @@ less_parts (GtkWidget *button, static void attach_rule (GtkWidget *rule, FilterRuleData *data, - EFilterPart *part, gint row) + EFilterPart *part, + gint row) { GtkWidget *remove; @@ -611,7 +612,8 @@ filter_rule_build_code (EFilterRule *rule, } static void -filter_rule_copy (EFilterRule *dest, EFilterRule *src) +filter_rule_copy (EFilterRule *dest, + EFilterRule *src) { GList *node; @@ -658,7 +660,7 @@ filter_rule_get_widget (EFilterRule *rule, gint rows, i; /* this stuff should probably be a table, but the - rule parts need to be a vbox */ + * rule parts need to be a vbox */ vbox = gtk_vbox_new (FALSE, 6); label = gtk_label_new_with_mnemonic (_("R_ule name:")); @@ -723,7 +725,7 @@ filter_rule_get_widget (EFilterRule *rule, label = gtk_label_new_with_mnemonic (_("_Find items:")); combobox = gtk_combo_box_text_new (); - for (i=0;i<2;i++) { + for (i = 0; i < 2; i++) { gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (combobox), _(thread_types[i])); @@ -759,7 +761,7 @@ filter_rule_get_widget (EFilterRule *rule, label = gtk_label_new_with_mnemonic (_("I_nclude threads:")); combobox = gtk_combo_box_text_new (); - for (i=0;i<5;i++) { + for (i = 0; i < 5; i++) { gtk_combo_box_text_append_text ( GTK_COMBO_BOX_TEXT (combobox), _(thread_types[i])); @@ -1107,7 +1109,7 @@ e_filter_rule_next_list (GList *list, } EFilterRule * -e_filter_rule_find_list (GList * list, +e_filter_rule_find_list (GList *list, const gchar *name, const gchar *source) { diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c index 712ecfa039..2f3daca6e7 100644 --- a/filter/e-rule-context.c +++ b/filter/e-rule-context.c @@ -280,7 +280,7 @@ rule_context_load (ERuleContext *context, /* now load actual rules */ if (userdoc) { root = xmlDocGetRootElement (userdoc); - set = root?root->children:NULL; + set = root ? root->children : NULL; while (set) { rule_map = g_hash_table_lookup (context->rule_set_map, set->name); if (rule_map) { @@ -373,7 +373,7 @@ rule_context_revert (ERuleContext *context, /* setup stuff we have now */ /* Note that we assume there is only 1 set of rules in a given rule context, - although other parts of the code dont assume this */ + * although other parts of the code dont assume this */ frule = NULL; while ((frule = e_rule_context_next_rule (context, frule, NULL))) { rest_data = g_hash_table_lookup (source_hash, frule->source); @@ -387,7 +387,7 @@ rule_context_revert (ERuleContext *context, /* make what we have, match what we load */ set = xmlDocGetRootElement (userdoc); - set = set?set->children:NULL; + set = set ? set->children : NULL; while (set) { rule_map = g_hash_table_lookup (context->rule_set_map, set->name); if (rule_map) { diff --git a/filter/e-rule-editor.c b/filter/e-rule-editor.c index 3fdf5c40bc..eb52691c5b 100644 --- a/filter/e-rule-editor.c +++ b/filter/e-rule-editor.c @@ -127,7 +127,8 @@ rule_editor_play_undo (ERuleEditor *editor) } static void -dialog_rule_changed (EFilterRule *fr, GtkWidget *dialog) +dialog_rule_changed (EFilterRule *fr, + GtkWidget *dialog) { g_return_if_fail (dialog != NULL); @@ -135,7 +136,9 @@ dialog_rule_changed (EFilterRule *fr, GtkWidget *dialog) } static void -add_editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) +add_editor_response (GtkWidget *dialog, + gint button, + ERuleEditor *editor) { GtkTreeSelection *selection; GtkTreePath *path; @@ -211,7 +214,8 @@ update_selected_rule (ERuleEditor *editor) } static void -cursor_changed (GtkTreeView *treeview, ERuleEditor *editor) +cursor_changed (GtkTreeView *treeview, + ERuleEditor *editor) { if (update_selected_rule (editor)) { g_return_if_fail (editor->current); @@ -221,7 +225,9 @@ cursor_changed (GtkTreeView *treeview, ERuleEditor *editor) } static void -editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) +editor_response (GtkWidget *dialog, + gint button, + ERuleEditor *editor) { if (button == GTK_RESPONSE_CANCEL) { if (enable_undo) @@ -242,7 +248,8 @@ editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) } static void -rule_add (GtkWidget *widget, ERuleEditor *editor) +rule_add (GtkWidget *widget, + ERuleEditor *editor) { GtkWidget *rules; GtkWidget *content_area; @@ -281,7 +288,9 @@ rule_add (GtkWidget *widget, ERuleEditor *editor) } static void -edit_editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) +edit_editor_response (GtkWidget *dialog, + gint button, + ERuleEditor *editor) { EFilterRule *rule; GtkTreePath *path; @@ -326,7 +335,8 @@ edit_editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) } static void -rule_edit (GtkWidget *widget, ERuleEditor *editor) +rule_edit (GtkWidget *widget, + ERuleEditor *editor) { GtkWidget *rules; GtkWidget *content_area; @@ -367,7 +377,8 @@ rule_edit (GtkWidget *widget, ERuleEditor *editor) } static void -rule_delete (GtkWidget *widget, ERuleEditor *editor) +rule_delete (GtkWidget *widget, + ERuleEditor *editor) { GtkTreeSelection *selection; GtkTreePath *path; @@ -422,7 +433,9 @@ rule_delete (GtkWidget *widget, ERuleEditor *editor) } static void -rule_move (ERuleEditor *editor, gint from, gint to) +rule_move (ERuleEditor *editor, + gint from, + gint to) { GtkTreeSelection *selection; GtkTreePath *path; @@ -466,7 +479,8 @@ rule_move (ERuleEditor *editor, gint from, gint to) } static void -rule_top (GtkWidget *widget, ERuleEditor *editor) +rule_top (GtkWidget *widget, + ERuleEditor *editor) { gint pos; @@ -479,7 +493,8 @@ rule_top (GtkWidget *widget, ERuleEditor *editor) } static void -rule_up (GtkWidget *widget, ERuleEditor *editor) +rule_up (GtkWidget *widget, + ERuleEditor *editor) { gint pos; @@ -492,7 +507,8 @@ rule_up (GtkWidget *widget, ERuleEditor *editor) } static void -rule_down (GtkWidget *widget, ERuleEditor *editor) +rule_down (GtkWidget *widget, + ERuleEditor *editor) { gint pos; @@ -505,7 +521,8 @@ rule_down (GtkWidget *widget, ERuleEditor *editor) } static void -rule_bottom (GtkWidget *widget, ERuleEditor *editor) +rule_bottom (GtkWidget *widget, + ERuleEditor *editor) { gint pos; gint count = 0; @@ -720,7 +737,10 @@ e_rule_editor_create_rule (ERuleEditor *editor) } static void -double_click (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, ERuleEditor *editor) +double_click (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *column, + ERuleEditor *editor) { GtkTreeSelection *selection; GtkTreeModel *model; -- cgit v1.2.3