From 9f381f8245d3de8f05dc3ddc560a635a7ef3f717 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 6 Jul 2000 01:52:51 +0000 Subject: remove some non-error case debugging messages. * remove some non-error case debugging messages. svn path=/trunk/; revision=3904 --- filter/ChangeLog | 2 ++ filter/filter-arg-types.c | 4 ---- filter/filter-arg.c | 11 ----------- filter/filter-driver.c | 42 +++++------------------------------------- filter/filter-druid.c | 22 ---------------------- filter/filter-editor.c | 16 +++------------- 6 files changed, 10 insertions(+), 87 deletions(-) (limited to 'filter') diff --git a/filter/ChangeLog b/filter/ChangeLog index 0b22d8753d..943b1736bd 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,5 +1,7 @@ 2000-07-05 Dan Winship + * remove some non-error case debugging messages. + * filtertypes.xml: Fix typos and update the "to-address" rule to match To or Cc. * vfoldertypes.xml: Fix typos. diff --git a/filter/filter-arg-types.c b/filter/filter-arg-types.c index 914ab8343a..578eeee64e 100644 --- a/filter/filter-arg-types.c +++ b/filter/filter-arg-types.c @@ -409,8 +409,6 @@ arg_address_get_value_as_string(FilterArg *argin, void *data) { struct filter_arg_address *a = (struct filter_arg_address *)data; - printf("geting address as string : %s %s\n", a->email, a->name); - if (a->email == NULL || a->email[0] == '\0') { if (a->name == NULL @@ -698,8 +696,6 @@ arg_folder_values_add_xml(FilterArg *arg, xmlNodePtr node) { xmlNodePtr n; - printf("adding folder values ...\n"); - n = node->childs; while (n) { if (!strcmp(n->name, "folder")) { diff --git a/filter/filter-arg.c b/filter/filter-arg.c index 8514f26b43..8d659d7af9 100644 --- a/filter/filter-arg.c +++ b/filter/filter-arg.c @@ -324,10 +324,6 @@ filter_arg_edit_add(GtkWidget *w, struct filter_arg_edit *edata) GtkWidget *listitem; int i; - printf("adding new item\n"); - - printf("editing ...\n"); - i = filter_arg_edit_value(edata->arg, -1); if (i>=0) { gtk_list_remove_items_no_unref(edata->list, edata->items); @@ -367,11 +363,8 @@ fill_list(struct filter_arg_edit *edata) gtk_object_set_data((GtkObject *)listitem, "arg_i", filter_arg_get_value(edata->arg, i)); items = g_list_append(items, listitem); gtk_widget_show(GTK_WIDGET(listitem)); - printf("adding item %d\n", i); } - printf("items re-added\n"); - edata->item_current = NULL; edata->items = items; @@ -420,8 +413,6 @@ filter_arg_edit_select(GtkWidget *w, GtkListItem *list, struct filter_arg_edit * { edata->item_current = GTK_WIDGET (list); edit_sensitise(edata); - - printf ("node = %p\n", g_list_find(edata->items, edata->item_current)); } static void @@ -436,12 +427,10 @@ filter_arg_edit_clicked(GnomeDialog *d, int button, struct filter_arg_edit *edat { struct _FilterArgPrivate *p = _PRIVATE(edata->arg); - printf("window finished\n"); if (button == 0) { gtk_signal_emit(GTK_OBJECT(edata->arg), signals[CHANGED]); } else { /* cancel button, restore old values ... */ - printf("cancel button\n"); while (edata->arg->values) { filter_arg_remove(edata->arg, edata->arg->values->data); } diff --git a/filter/filter-driver.c b/filter/filter-driver.c index 9fb3a78d7a..aa26e38f51 100644 --- a/filter/filter-driver.c +++ b/filter/filter-driver.c @@ -193,17 +193,14 @@ filter_driver_new (const char *system, const char *user, FilterFolderFetcher fet p->fetcher = fetcher; - printf("Loading system '%s'\nLoading user '%s'\n", system, user); - #warning "fix leaks, free xml docs here" desc = xmlParseFile(system); p->rules = filter_load_ruleset(desc); filt = xmlParseFile(user); - if (filt == NULL) { - g_warning("Couldn't load filter file %s!", user); + if (filt == NULL) p->options = NULL; - } else + else p->options = filter_load_optionset(filt, p->rules); return new; @@ -249,8 +246,6 @@ expand_variables(GString *out, char *source, GList *args, GHashTable *globals) int len=0; int ok = 0; - printf("expanding %s\n", source); - start = source; while ( (newstart = strstr(start, "${")) && (end = strstr(newstart+2, "}")) ) { @@ -261,27 +256,23 @@ expand_variables(GString *out, char *source, GList *args, GHashTable *globals) } memcpy(name, newstart+2, len); name[len] = 0; - printf("looking for name '%s'\n", name); argl = g_list_find_custom(args, name, (GCompareFunc) filter_find_arg); if (argl) { int i, count; tmp = g_strdup_printf("%.*s", newstart-start, start); - printf("appending: %s\n", tmp); g_string_append(out, tmp); g_free(tmp); arg = argl->data; count = filter_arg_get_count(arg); for (i=0;idata; if (or->rule->type == FILTER_XML_MATCH || or->rule->type == FILTER_XML_EXCEPT) { - if (or->args) { + if (or->args) arg = or->args->data; - if (arg) { - printf("arg = %s\n", arg->name); - } - } expand_variables(s, or->rule->code, or->args, p->globals); } optionl = g_list_next(optionl); @@ -345,11 +331,6 @@ filter_driver_expand_option(FilterDriver *d, GString *s, GString *action, struct } g_string_append(action, ")"); } - - if (s) - printf("combined rule '%s'\n", s->str); - if (action) - printf("combined action '%s'\n", action->str); } static ESExpResult * @@ -401,20 +382,15 @@ do_copy(struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *d) char *folder = argv[i]->value.string; CamelFolder *outbox; - /* FIXME: this might have to find another store, based on - the folder as a url??? */ - printf("opening outpbox %s\n", folder); outbox = open_folder(d, folder); - if (outbox == NULL) { - g_warning("Cannot open folder: %s", folder); + if (outbox == NULL) continue; - } m = p->matches; while (m) { CamelMimeMessage *mm; - printf("appending message %s\n", (char *)m->data); + printf("appending message %s to %s\n", (char *)m->data, folder); mm = camel_folder_get_message(p->source, m->data, p->ex); camel_folder_append_message(outbox, mm, p->ex); @@ -425,7 +401,6 @@ do_copy(struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *d) g_hash_table_insert(p->processed, g_strdup(m->data), (void *)1); } - printf(" %s\n", (char *)m->data); m = m->next; } } @@ -480,8 +455,6 @@ close_folder(void *key, void *value, void *data) FilterDriver *d = data; struct _FilterDriverPrivate *p = _PRIVATE(d); - printf("closing folder: %s\n", (char *) key); - g_free(key); camel_folder_sync(f, FALSE, p->ex); camel_folder_thaw(f); @@ -546,7 +519,6 @@ filter_driver_run(FilterDriver *d, CamelFolder *source, CamelFolder *inbox) a = g_string_new(""); filter_driver_expand_option(d, s, a, fo); - printf("searching expression %s\n", s->str); p->matches = camel_folder_search_by_expression (p->source, s->str, p->ex); /* remove uid's for which processing is complete ... */ @@ -554,16 +526,12 @@ filter_driver_run(FilterDriver *d, CamelFolder *source, CamelFolder *inbox) while (m) { GList *n = m->next; - printf("matched: %s\n", (char *) m->data); - if (g_hash_table_lookup(p->terminated, m->data)) { - printf("removing terminated message %s\n", (char *)m->data); p->matches = g_list_remove_link(p->matches, m); } m = n; } - printf("applying actions ... '%s'\n", a->str); e_sexp_input_text(p->eval, a->str, strlen(a->str)); e_sexp_parse(p->eval); r = e_sexp_eval(p->eval); diff --git a/filter/filter-druid.c b/filter/filter-druid.c index 9b0b03749d..f516112d5d 100644 --- a/filter/filter-druid.c +++ b/filter/filter-druid.c @@ -270,8 +270,6 @@ fill_rules(GList *rules, struct filter_option *option, int type) labeltext = filter_description_text(fr->description, NULL); - printf("adding rule %s\n", labeltext); - hbox = gtk_hbox_new(FALSE, 3); checkbox = gnome_pixmap_new_from_xpm_d(state?check_xpm:blank_xpm); gtk_box_pack_start(GTK_BOX(hbox), checkbox, FALSE, FALSE, 0); @@ -333,7 +331,6 @@ select_rule_child(GtkList *list, GtkWidget *child, FilterDruid *f) gtk_object_set_data(GTK_OBJECT(child), "checkstate", (void *)state); if (state) { - printf("adding rule %p\n", fr); rule = filter_optionrule_new_from_rule(fr); f->option_current->options = g_list_append(f->option_current->options, rule); } else { @@ -369,7 +366,6 @@ select_option_child(GtkList *list, GtkWidget *child, FilterDruid *f) } if (f->option_current) { - printf("freeing current option\n"); /* free option_current copy */ optionsl = f->option_current->options; while (optionsl) { @@ -385,8 +381,6 @@ select_option_child(GtkList *list, GtkWidget *child, FilterDruid *f) if (child) { op = gtk_object_get_data(GTK_OBJECT(child), "option"); - printf("option = %p\n", op); - /* clone the option */ new = g_malloc(sizeof(*new)); new->type = op->type; @@ -411,7 +405,6 @@ select_option_child(GtkList *list, GtkWidget *child, FilterDruid *f) static void unselect_option_child(GtkList *list, GtkWidget *child, FilterDruid *f) { - printf("unselect option child\n"); select_option_child(list, NULL, f); } @@ -420,8 +413,6 @@ arg_changed(FilterArg *arg, FilterDruid *f) { FilterArg *orig; - printf("value changed!!!\n"); - orig = gtk_object_get_data(GTK_OBJECT (arg), "origin"); if (orig) { filter_arg_copy(orig, arg); @@ -435,14 +426,11 @@ arg_changed(FilterArg *arg, FilterDruid *f) static void arg_link_clicked(GtkHTML *html, const char *url, FilterDruid *f) { - printf("url clicked: %s\n", url); if (!strncmp(url, "arg:", 4)) { FilterArg *arg; void *dummy; if ((sscanf(url+4, "%p %p", &dummy, &arg) == 2) && arg) { - printf("arg = %p\n", arg); - gtk_signal_connect(GTK_OBJECT (arg), "changed", arg_changed, f); filter_arg_edit_values(arg); } @@ -454,8 +442,6 @@ option_name_changed(GtkEntry *entry, FilterDruid *f) { struct filter_desc *desc; - printf("name changed: %s\n", gtk_entry_get_text(entry)); - if (f->option_current) { /* FIXME: lots of memory leaks */ desc = g_malloc0(sizeof(*desc)); @@ -476,8 +462,6 @@ dialogue_clicked(FilterDruid *d, int button, void *data) struct _FilterDruidPrivate *p = _PRIVATE(d); int initial=0; - printf("button %d clicked ...\n", button); - g_string_free(s, TRUE); switch(button) { @@ -509,14 +493,9 @@ update_display(FilterDruid *f, int initial) { struct _FilterDruidPrivate *p = _PRIVATE(f); - printf("rending page %d options\n", p->page); - switch (p->page) { case 0: - printf("option_current = %p <###################\n", f->option_current); - if (initial) { - printf("adding options\n"); gtk_signal_handler_block_by_data((GtkObject *)p->list0, f); gtk_list_remove_items((GtkList *)p->list0, p->items0); p->items0 = fill_options(f->options); @@ -531,7 +510,6 @@ update_display(FilterDruid *f, int initial) case 2: case 3: if (initial) { - printf("adding rules\n"); gtk_signal_handler_block_by_data((GtkObject *)p->list0, f); gtk_list_remove_items((GtkList *)p->list0, p->items0); p->items0 = fill_rules(f->rules, f->option_current, filter_types[p->page-1]); diff --git a/filter/filter-editor.c b/filter/filter-editor.c index 61ec13732c..3bd239befa 100644 --- a/filter/filter-editor.c +++ b/filter/filter-editor.c @@ -70,7 +70,7 @@ filter_editor_get_type (void) } static void -object_destroy(FilterEditor *obj) +object_destroy(GtkObject *obj) { struct _FilterEditorPrivate *p = _PRIVATE(obj); @@ -114,7 +114,6 @@ sensitise(FilterEditor *e) static void druid_option_selected(FilterDruid *f, struct filter_option *option, FilterEditor *e) { - printf("option selected: %p\n", option); e->option_current = option; sensitise(e); } @@ -137,7 +136,6 @@ druid_dialogue_clicked(GnomeDialog *d, int button, FilterEditor *e) } break; case 2: - printf("Finish!\n"); if (p->druid_druid->option_current) { #warning "what is going on here?" /* FIXME: should this be struct filter_option?? */ @@ -165,7 +163,6 @@ druid_dialogue_clicked(GnomeDialog *d, int button, FilterEditor *e) filter_druid_set_rules(p->druid, e->useroptions, e->rules, or); } case 3: - printf("cancel!\n"); p->druid_dialogue = NULL; gnome_dialog_close(d); return; @@ -199,7 +196,7 @@ add_or_edit(FilterEditor *e, struct filter_option *option) } dialogue = GNOME_DIALOG (gnome_dialog_new (option ? _("Edit Filter") : _("Create filter"), NULL)); - p->druid_dialogue = dialogue; + p->druid_dialogue = GTK_WIDGET (dialogue); { const char *pixmaps[] = { GNOME_STOCK_BUTTON_PREV, @@ -255,16 +252,12 @@ add_or_edit(FilterEditor *e, struct filter_option *option) static void add_clicked(GtkWidget *w, FilterEditor *e) { - printf("add new ...\n"); - add_or_edit(e, NULL); } static void edit_clicked(GtkWidget *w, FilterEditor *e) { - printf("add new ...\n"); - add_or_edit(e, e->option_current); } @@ -367,7 +360,7 @@ void filter_editor_set_rule_files(FilterEditor *e, const char *systemrules, const char *userrules) { GList *rules, *options = NULL, *options2; - xmlDocPtr doc, out, optionset, filteroptions; + xmlDocPtr doc, out; doc = xmlParseFile(systemrules); if( doc == NULL ) { @@ -383,9 +376,6 @@ filter_editor_set_rule_files(FilterEditor *e, const char *systemrules, const cha if (out) options = filter_load_optionset(out, rules); - printf("Loading system rules: %s = %p = %p\n", systemrules, doc, rules); - printf("Loading user rules: %s = %p = %p\n", userrules, out, options); - filter_editor_set_rules(e, rules, options2, options); } -- cgit v1.2.3