[gtk+] Change gtk_css_provider_propagate_error's signature.
- From: Eitan Isaacson <eitani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Change gtk_css_provider_propagate_error's signature.
- Date: Fri, 2 Sep 2011 16:20:16 +0000 (UTC)
commit 6eb777a8afb9d0a8b868cc6e71da85bcc4c7fa9c
Author: Eitan Isaacson <eitan monotonous org>
Date: Wed Aug 31 15:24:53 2011 -0700
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 files changed, 31 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index dd73322..6f5faed 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 = "<broken file>";
+ }
+ else
+ {
+ info = NULL;
+ path = "<unknown>";
+ }
+
/* 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 : "<unknown>", 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 : "<unknown>", 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]