From 6eb777a8afb9d0a8b868cc6e71da85bcc4c7fa9c Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Wed, 31 Aug 2011 15:24:53 -0700 Subject: [PATCH] Change gtk_css_provider_propagate_error's signature. Update to new parsing-error signal. https://bugzilla.gnome.org/show_bug.cgi?id=657882 --- gtk/gtkcssprovider.c | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index dd73322ec5..6f5faed7d6 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -1666,16 +1666,37 @@ gtk_css_provider_reset (GtkCssProvider *css_provider) static void gtk_css_provider_propagate_error (GtkCssProvider *provider, - const gchar *path, - guint line, - guint position, + GtkCssSection *section, const GError *error, GError **propagate_to) { + + GFileInfo *info; + GFile *file; + const char *path; + + file = gtk_css_section_get_file (section); + if (file) + { + info = g_file_query_info (file,G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, 0, NULL, NULL); + + if (info) + path = g_file_info_get_display_name (info); + else + path = ""; + } + else + { + info = NULL; + path = ""; + } + /* don't fail for deprecations */ if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED)) { - g_warning ("Theme parsing error: %s:%u:%u: %s", path ? path : "", line, position, error->message); + g_warning ("Theme parsing error: %s:%u:%u: %s", path, + gtk_css_section_get_end_line (section) + 1, + gtk_css_section_get_end_position (section), error->message); return; } @@ -1684,7 +1705,12 @@ gtk_css_provider_propagate_error (GtkCssProvider *provider, return; *propagate_to = g_error_copy (error); - g_prefix_error (propagate_to, "%s:%u:%u: ", path ? path : "", line, position); + g_prefix_error (propagate_to, "%s:%u:%u: ", path, + gtk_css_section_get_end_line (section) + 1, + gtk_css_section_get_end_position (section)); + + if (info) + g_object_unref (info); } static gboolean