Skip to content

Commit

Permalink
filefilter: Fix <suffixes> in buildable
Browse files Browse the repository at this point in the history
A bug in GtkFileFilter's GtkBuildable implementation caused the
<suffixes> tag not to be recognized.
  • Loading branch information
jameswestman committed Mar 17, 2022
1 parent b90132c commit 8eb9844
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gtk/gtkfilefilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ parser_start_element (GtkBuildableParseContext *context,
}

if (strcmp (element_name, "mime-types") == 0 ||
strcmp (element_name, "patterns") == 0)
strcmp (element_name, "patterns") == 0 ||
strcmp (element_name, "suffixes") == 0)
{
if (!_gtk_builder_check_parent (data->builder, context, "object", error))
return;
Expand Down Expand Up @@ -422,7 +423,8 @@ gtk_file_filter_buildable_custom_tag_end (GtkBuildable *buildable,
gpointer user_data)
{
if (strcmp (tagname, "mime-types") == 0 ||
strcmp (tagname, "patterns") == 0)
strcmp (tagname, "patterns") == 0 ||
strcmp (tagname, "suffixes") == 0)
{
SubParserData *data = (SubParserData*)user_data;

Expand Down
4 changes: 4 additions & 0 deletions testsuite/gtk/ui/filefilter1.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@
<pattern>*.txt</pattern>
<pattern>*.png</pattern>
</patterns>
<suffixes>
<suffix>txt</suffix>
<suffix>png</suffix>
</suffixes>
</object>
</interface>

0 comments on commit 8eb9844

Please sign in to comment.