From edddb38414fcaf01150e7b3b1ee0175cf8f72ac2 Mon Sep 17 00:00:00 2001 From: Vladimir Nadvornik Date: Fri, 20 Mar 2009 10:12:29 +0000 Subject: [PATCH] be more verbose on parse errors --- src/bar.c | 2 +- src/bar_comment.c | 2 +- src/bar_exif.c | 4 ++-- src/bar_histogram.c | 2 +- src/bar_keywords.c | 2 +- src/bar_sort.c | 2 +- src/filefilter.c | 2 +- src/layout.c | 2 +- src/layout_util.c | 2 +- src/metadata.c | 2 +- src/rcfile.c | 29 ++++++++++++++--------------- 11 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/bar.c b/src/bar.c index 1d4d5321..90a28da1 100644 --- a/src/bar.c +++ b/src/bar.c @@ -351,7 +351,7 @@ GtkWidget *bar_new_from_config(LayoutWindow *lw, const gchar **attribute_names, if (READ_INT_FULL("width", width)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } gtk_widget_set_size_request(bar, width, -1); diff --git a/src/bar_comment.c b/src/bar_comment.c index 04231574..849745ab 100644 --- a/src/bar_comment.c +++ b/src/bar_comment.c @@ -275,7 +275,7 @@ GtkWidget *bar_pane_comment_new_from_config(const gchar **attribute_names, const if (READ_INT_FULL("height", height)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } return bar_pane_comment_new(title, key, expanded, height); diff --git a/src/bar_exif.c b/src/bar_exif.c index 74f1c035..185f11ef 100644 --- a/src/bar_exif.c +++ b/src/bar_exif.c @@ -782,7 +782,7 @@ GtkWidget *bar_pane_exif_new_from_config(const gchar **attribute_names, const gc if (READ_CHAR_FULL("pane.title", title)) continue; if (READ_BOOL_FULL("pane.expanded", expanded)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } return bar_pane_exif_new(title, expanded, FALSE); @@ -809,7 +809,7 @@ void bar_pane_exif_entry_add_from_config(GtkWidget *pane, const gchar **attribut if (READ_BOOL_FULL("if_set", if_set)) continue; if (READ_BOOL_FULL("editable", editable)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } if (key && key[0]) bar_pane_exif_add_entry(ped, key, title, if_set, editable); diff --git a/src/bar_histogram.c b/src/bar_histogram.c index f4c6038e..7f8fcd9e 100644 --- a/src/bar_histogram.c +++ b/src/bar_histogram.c @@ -391,7 +391,7 @@ GtkWidget *bar_pane_histogram_new_from_config(const gchar **attribute_names, con if (READ_INT_FULL("histogram_channel", histogram_channel)) continue; if (READ_INT_FULL("histogram_mode", histogram_mode)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } return bar_pane_histogram_new(title, height, expanded, histogram_channel, histogram_mode); diff --git a/src/bar_keywords.c b/src/bar_keywords.c index 451e68c7..d2a8ee21 100644 --- a/src/bar_keywords.c +++ b/src/bar_keywords.c @@ -1359,7 +1359,7 @@ GtkWidget *bar_pane_keywords_new_from_config(const gchar **attribute_names, cons if (READ_BOOL_FULL("pane.expanded", expanded)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } return bar_pane_keywords_new(title, key, expanded); diff --git a/src/bar_sort.c b/src/bar_sort.c index a137bc29..249939ff 100644 --- a/src/bar_sort.c +++ b/src/bar_sort.c @@ -701,7 +701,7 @@ GtkWidget *bar_sort_new_from_config(LayoutWindow *lw, const gchar **attribute_na if (READ_INT_CLAMP_FULL("selection", selection, 0, BAR_SORT_SELECTION_COUNT - 1)) continue; if (READ_CHAR_FULL("filter_key", filter_key)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } bar = bar_sort_new(lw, action, mode, selection, filter_key); diff --git a/src/filefilter.c b/src/filefilter.c index b0350733..d9d6f2b1 100644 --- a/src/filefilter.c +++ b/src/filefilter.c @@ -459,7 +459,7 @@ void filter_load_file_type(const gchar **attribute_names, const gchar **attribut if (READ_BOOL(fe, writable)) continue; if (READ_BOOL(fe, allow_sidecar)) continue; - printf("unknown attribute %s = %s\n", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } if (fe.file_class >= FILE_FORMAT_CLASSES) fe.file_class = FORMAT_CLASS_UNKNOWN; diff --git a/src/layout.c b/src/layout.c index 44d2871e..93fb0212 100644 --- a/src/layout.c +++ b/src/layout.c @@ -2434,7 +2434,7 @@ void layout_load_attributes(LayoutOptions *layout, const gchar **attribute_names if (READ_INT(*layout, image_overlay.histogram_channel)) continue; if (READ_INT(*layout, image_overlay.histogram_mode)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } } diff --git a/src/layout_util.c b/src/layout_util.c index 6255239c..d2a9cd6a 100644 --- a/src/layout_util.c +++ b/src/layout_util.c @@ -1875,7 +1875,7 @@ void layout_toolbar_add_from_config(LayoutWindow *lw, const gchar **attribute_na if (READ_CHAR_FULL("action", action)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } layout_toolbar_add(lw, action); diff --git a/src/metadata.c b/src/metadata.c index 909d1911..07eb512a 100644 --- a/src/metadata.c +++ b/src/metadata.c @@ -1287,7 +1287,7 @@ GtkTreeIter *keyword_add_from_config(GtkTreeStore *keyword_tree, GtkTreeIter *pa if (READ_CHAR_FULL("name", name)) continue; if (READ_BOOL_FULL("kw", is_kw)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } if (name && name[0]) { diff --git a/src/rcfile.c b/src/rcfile.c index 8c9da17b..cdc66265 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -721,7 +721,7 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar ** if (READ_BOOL(*options, metadata.confirm_on_image_change)) continue; if (READ_BOOL(*options, metadata.confirm_on_dir_change)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } return TRUE; @@ -740,7 +740,7 @@ static void options_load_color_profiles(GQParserData *parser_data, GMarkupParseC if (READ_INT(options->color_profile, screen_type)) continue; if (READ_CHAR(options->color_profile, screen_file)) continue; - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } } @@ -756,9 +756,8 @@ static void options_load_profile(GQParserData *parser_data, GMarkupParseContext if (READ_CHAR_FULL("input_file", options->color_profile.input_file[i])) continue; if (READ_CHAR_FULL("input_name", options->color_profile.input_name[i])) continue; - - DEBUG_1("unknown attribute %s = %s", option, value); + log_printf("unknown attribute %s = %s\n", option, value); } i++; options_parse_func_set_data(parser_data, GINT_TO_POINTER(i)); @@ -781,7 +780,7 @@ struct _GQParserData void options_parse_leaf(GQParserData *parser_data, GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer data, GError **error) { - DEBUG_1("unexpected: %s", element_name); + log_printf("unexpected: %s\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } @@ -794,7 +793,7 @@ static void options_parse_color_profiles(GQParserData *parser_data, GMarkupParse } else { - DEBUG_1("unexpected profile: %s", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } @@ -808,7 +807,7 @@ static void options_parse_filter(GQParserData *parser_data, GMarkupParseContext } else { - DEBUG_1("unexpected filter: %s", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } @@ -836,7 +835,7 @@ static void options_parse_keyword(GQParserData *parser_data, GMarkupParseContext } else { - DEBUG_1("unexpected in : <%s>", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } @@ -852,7 +851,7 @@ static void options_parse_keyword_tree(GQParserData *parser_data, GMarkupParseCo } else { - DEBUG_1("unexpected in : <%s>", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } @@ -876,7 +875,7 @@ static void options_parse_global(GQParserData *parser_data, GMarkupParseContext } else { - DEBUG_1("unexpected global: %s", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } @@ -897,7 +896,7 @@ static void options_parse_pane_exif(GQParserData *parser_data, GMarkupParseConte } else { - DEBUG_1("unexpected in : <%s>", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } @@ -931,7 +930,7 @@ static void options_parse_bar(GQParserData *parser_data, GMarkupParseContext *co } else { - DEBUG_1("unexpected in : <%s>", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } @@ -946,7 +945,7 @@ static void options_parse_toolbar(GQParserData *parser_data, GMarkupParseContext } else { - DEBUG_1("unexpected in : <%s>", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } @@ -973,7 +972,7 @@ static void options_parse_layout(GQParserData *parser_data, GMarkupParseContext } else { - DEBUG_1("unexpected in : <%s>", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } @@ -1007,7 +1006,7 @@ static void options_parse_toplevel(GQParserData *parser_data, GMarkupParseContex } else { - DEBUG_1("unexpected in : <%s>", element_name); + log_printf("unexpected in : <%s>\n", element_name); options_parse_func_push(parser_data, options_parse_leaf, NULL, NULL); } } -- 2.20.1