From 9e555e244adbaae4e9917b75a1e4e3f343517b8c Mon Sep 17 00:00:00 2001 From: Alfons Hoogervorst Date: Sun, 23 Dec 2001 19:02:36 +0000 Subject: [PATCH 1/1] clean up a little bit --- ChangeLog.claws | 6 ++++++ src/importmutt.c | 8 ++++---- src/matcher.c | 38 ++++++++++++-------------------------- src/prefs_filter.c | 1 - src/prefs_filtering.c | 9 --------- 5 files changed, 22 insertions(+), 40 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 275142770..79baf0c04 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,4 +1,10 @@ 2001-12-23 [alfons] 0.6.6claws13 + + * src/prefs_filter.c + * src/prefs_filtering.c + * src/matcher.c + * src/importmutt.c + clean up a little bit * src/string_match.c validate input strings a little bit more diff --git a/src/importmutt.c b/src/importmutt.c index 953a83e09..9e933380f 100644 --- a/src/importmutt.c +++ b/src/importmutt.c @@ -271,7 +271,7 @@ static void imp_mutt_create( gboolean *cancelled ) { gtk_table_set_row_spacings(GTK_TABLE(table), 8); gtk_table_set_col_spacings(GTK_TABLE(table), 8 ); - // First row + /* First row */ top = 0; label = gtk_label_new(_("Name")); gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0); @@ -280,7 +280,7 @@ static void imp_mutt_create( gboolean *cancelled ) { name_entry = gtk_entry_new(); gtk_table_attach(GTK_TABLE(table), name_entry, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0); - // Second row + /* Second row */ top = 1; label = gtk_label_new(_("File")); gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0); @@ -292,13 +292,13 @@ static void imp_mutt_create( gboolean *cancelled ) { file_btn = gtk_button_new_with_label( _(" ... ")); gtk_table_attach(GTK_TABLE(table), file_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0); - // Status line + /* Status line */ hsbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH); statusbar = gtk_statusbar_new(); gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH); - // Button panel + /* Button panel */ gtkut_button_set_create(&hbbox, &ok_btn, _("OK"), &cancel_btn, _("Cancel"), NULL, NULL); gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0); diff --git a/src/matcher.c b/src/matcher.c index 58b3fdb0a..1e2c89fb8 100644 --- a/src/matcher.c +++ b/src/matcher.c @@ -90,15 +90,8 @@ static MatchParser matchparser_tab[] = { {MATCHACTION_BOUNCE, "bounce"} }; -/* - syntax for matcher - - header "x-mailing" match "toto" score -10 - subject match "regexp" & to regexp "regexp" score 50 - subject match "regexp" | to regexpcase "regexp" | age_sup 5 score 30 - -*/ - +/* get_matchparser_tab_str() - used by filtering.c to translate + * actions to debug strings */ gchar * get_matchparser_tab_str(gint id) { gint i; @@ -156,7 +149,8 @@ gchar *matcher_unescape_str(gchar *str) /* **************** data structure allocation **************** */ - +/* matcherprop_new() - allocates a structure for one condition + */ MatcherProp * matcherprop_new(gint criteria, gchar * header, gint matchtype, gchar * expr, int value) @@ -189,6 +183,8 @@ MatcherProp * matcherprop_new(gint criteria, gchar * header, return prop; } +/* matcherprop_free() + */ void matcherprop_free(MatcherProp * prop) { if (prop->expr) @@ -210,8 +206,8 @@ void matcherprop_free(MatcherProp * prop) /* ************** match ******************************/ -/* match the given string */ - +/* matcherprop_string_match() - finds out if a string matches + * with a criterium */ static gboolean matcherprop_string_match(MatcherProp * prop, gchar * str) { gchar * str1; @@ -654,8 +650,8 @@ gboolean matcherlist_match_file(MatcherList * matchers, MsgInfo * info, MatcherProp * matcher = (MatcherProp *) l->data; if (matcherprop_criteria_headers(matcher) || - matcherprop_criteria_body(matcher) || - matcherprop_criteria_message(matcher)) + matcherprop_criteria_body(matcher) || + matcherprop_criteria_message(matcher)) { if (matcher->result) { if (!matchers->bool_and) { result = TRUE; @@ -667,7 +663,8 @@ gboolean matcherlist_match_file(MatcherList * matchers, MsgInfo * info, result = FALSE; break; } - } + } + } } g_free(file); @@ -1015,13 +1012,7 @@ gchar * matching_build_command(gchar * cmd, MsgInfo * info) return processed_cmd; } - -/* ************************************************************ */ -/* ************************************************************ */ /* ************************************************************ */ -/* ************************************************************ */ -/* ************************************************************ */ - static void prefs_scoring_write(FILE * fp, GSList * prefs_scoring) { @@ -1148,11 +1139,6 @@ void prefs_matcher_write_config(void) } } - - - - - /* ******************************************************************* */ void prefs_matcher_read_config(void) diff --git a/src/prefs_filter.c b/src/prefs_filter.c index bb6d354d8..10d68a92e 100644 --- a/src/prefs_filter.c +++ b/src/prefs_filter.c @@ -368,7 +368,6 @@ static void prefs_filter_create(void) NULL); PACK_CHECK_BUTTON (dest_hbox, regex_chkbtn, _("Use regex")); - //gtk_widget_set_sensitive(regex_chkbtn, FALSE); gtk_signal_connect (GTK_OBJECT (regex_chkbtn), "toggled", GTK_SIGNAL_FUNC (prefs_filter_regex_check_button_toggled), diff --git a/src/prefs_filtering.c b/src/prefs_filtering.c index 3e91895a5..49c823d31 100644 --- a/src/prefs_filtering.c +++ b/src/prefs_filtering.c @@ -361,7 +361,6 @@ static void prefs_filtering_create(void) cond_entry = gtk_entry_new (); gtk_widget_show (cond_entry); -// gtk_widget_set_usize (cond_entry, 200, -1); gtk_box_pack_start (GTK_BOX (hbox1), cond_entry, TRUE, TRUE, 0); cond_btn = gtk_button_new_with_label (_("Define ...")); @@ -383,7 +382,6 @@ static void prefs_filtering_create(void) action_combo = gtk_combo_new (); gtk_widget_show (action_combo); -// gtk_widget_set_usize (action_combo, 200, -1); gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(action_combo)->entry), FALSE); @@ -473,13 +471,11 @@ static void prefs_filtering_create(void) dest_entry = gtk_entry_new (); gtk_widget_show (dest_entry); -// gtk_widget_set_usize (dest_entry, 200, -1); gtk_box_pack_start (GTK_BOX (hbox1), dest_entry, TRUE, TRUE, 0); color_optmenu = gtk_option_menu_new(); gtk_option_menu_set_menu(GTK_OPTION_MENU(color_optmenu), colorlabel_create_color_menu()); -// gtk_widget_set_usize(color_optmenu, -1, -1); gtk_box_pack_start(GTK_BOX(hbox1), color_optmenu, TRUE, TRUE, 0); dest_btn = gtk_button_new_with_label (_("Select ...")); @@ -496,11 +492,6 @@ static void prefs_filtering_create(void) GTK_SIGNAL_FUNC (prefs_matcher_exec_info), NULL); -// dummy = gtk_label_new(""); -// gtk_widget_show (dummy); -// gtk_box_pack_start(GTK_BOX (hbox1), dummy, FALSE, FALSE, 0); - - /* register / substitute / delete */ reg_hbox = gtk_hbox_new (FALSE, 4); -- 2.25.1