mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 00:11:29 +00:00
cssprovider: Remove unused members from scanner
Now that the parser takes care of the file, we don't need to keep track of it ourselves anymore.
This commit is contained in:
parent
859b6888c7
commit
b501e64a8a
@ -999,8 +999,6 @@ struct _GtkCssScanner
|
|||||||
GtkCssParser *parser;
|
GtkCssParser *parser;
|
||||||
GtkCssSection *section;
|
GtkCssSection *section;
|
||||||
GtkCssScanner *parent;
|
GtkCssScanner *parent;
|
||||||
GFile *file;
|
|
||||||
GFile *base;
|
|
||||||
GSList *state;
|
GSList *state;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1311,9 +1309,6 @@ gtk_css_scanner_destroy (GtkCssScanner *scanner)
|
|||||||
if (scanner->section)
|
if (scanner->section)
|
||||||
gtk_css_section_unref (scanner->section);
|
gtk_css_section_unref (scanner->section);
|
||||||
g_object_unref (scanner->provider);
|
g_object_unref (scanner->provider);
|
||||||
if (scanner->file)
|
|
||||||
g_object_unref (scanner->file);
|
|
||||||
g_object_unref (scanner->base);
|
|
||||||
_gtk_css_parser_free (scanner->parser);
|
_gtk_css_parser_free (scanner->parser);
|
||||||
|
|
||||||
g_slice_free (GtkCssScanner, scanner);
|
g_slice_free (GtkCssScanner, scanner);
|
||||||
@ -1357,18 +1352,6 @@ gtk_css_scanner_new (GtkCssProvider *provider,
|
|||||||
if (section)
|
if (section)
|
||||||
scanner->section = gtk_css_section_ref (section);
|
scanner->section = gtk_css_section_ref (section);
|
||||||
|
|
||||||
if (file)
|
|
||||||
{
|
|
||||||
scanner->file = g_object_ref (file);
|
|
||||||
scanner->base = g_file_get_parent (file);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char *dir = g_get_current_dir ();
|
|
||||||
scanner->base = g_file_new_for_path (dir);
|
|
||||||
g_free (dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
scanner->parser = _gtk_css_parser_new (text,
|
scanner->parser = _gtk_css_parser_new (text,
|
||||||
gtk_css_scanner_parser_error,
|
gtk_css_scanner_parser_error,
|
||||||
scanner);
|
scanner);
|
||||||
@ -1376,19 +1359,14 @@ gtk_css_scanner_new (GtkCssProvider *provider,
|
|||||||
return scanner;
|
return scanner;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GFile *
|
|
||||||
gtk_css_scanner_get_base_url (GtkCssScanner *scanner)
|
|
||||||
{
|
|
||||||
return scanner->base;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gtk_css_scanner_would_recurse (GtkCssScanner *scanner,
|
gtk_css_scanner_would_recurse (GtkCssScanner *scanner,
|
||||||
GFile *file)
|
GFile *file)
|
||||||
{
|
{
|
||||||
while (scanner)
|
while (scanner)
|
||||||
{
|
{
|
||||||
if (scanner->file && g_file_equal (scanner->file, file))
|
GFile *parser_file = _gtk_css_parser_get_file (scanner->parser);
|
||||||
|
if (parser_file && g_file_equal (parser_file, file))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
scanner = scanner->parent;
|
scanner = scanner->parent;
|
||||||
@ -1893,7 +1871,7 @@ parse_import (GtkCssScanner *scanner)
|
|||||||
char *uri;
|
char *uri;
|
||||||
|
|
||||||
uri = _gtk_css_parser_read_string (scanner->parser);
|
uri = _gtk_css_parser_read_string (scanner->parser);
|
||||||
file = g_file_resolve_relative_path (gtk_css_scanner_get_base_url (scanner), uri);
|
file = _gtk_css_parser_get_file_for_path (scanner->parser, uri);
|
||||||
g_free (uri);
|
g_free (uri);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user