forked from AuroraMiddleware/gtk
Change gtk_css_provider_propagate_error's signature.
Update to new parsing-error signal. https://bugzilla.gnome.org/show_bug.cgi?id=657882
This commit is contained in:
parent
0ee9a4790a
commit
6eb777a8af
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user