docs: Cleanups for the file filter docs

Now that GtkFileFilter is a GtkFilter, move it to the
filter section of the docs. While we are at it, touch
up the docs in some places.
This commit is contained in:
Matthias Clasen 2020-07-04 10:24:09 -04:00
parent 11dd602b28
commit 286a00a1db
2 changed files with 29 additions and 24 deletions

View File

@ -54,8 +54,9 @@
<section>
<xi:include href="xml/gtkfilter.xml" />
<xi:include href="xml/gtkcustomfilter.xml" />
<xi:include href="xml/gtkstringfilter.xml" />
<xi:include href="xml/gtkmultifilter.xml" />
<xi:include href="xml/gtkstringfilter.xml" />
<xi:include href="xml/gtkfilefilter.xml" />
</section>
<xi:include href="xml/gtkflattenlistmodel.xml" />
<xi:include href="xml/gtkmaplistmodel.xml" />
@ -285,7 +286,6 @@
<xi:include href="xml/gtkfilechoosernative.xml" />
<xi:include href="xml/gtkfilechooserdialog.xml" />
<xi:include href="xml/gtkfilechooserwidget.xml" />
<xi:include href="xml/gtkfilefilter.xml" />
<xi:include href="xml/gtkfontchooser.xml" />
<xi:include href="xml/gtkfontbutton.xml" />
<xi:include href="xml/gtkfontchooserwidget.xml" />

View File

@ -18,15 +18,14 @@
/**
* SECTION:gtkfilefilter
* @Short_description: A filter for selecting a file subset
* @Short_description: Filtering files
* @Title: GtkFileFilter
* @see_also: #GtkFileChooser
*
* A GtkFileFilter can be used to restrict the files being shown in a
* #GtkFileChooser. Files can be filtered based on their name (with
* gtk_file_filter_add_pattern()), on their mime type (with
* gtk_file_filter_add_mime_type()), or by a custom filter function
* (with gtk_file_filter_add_custom()).
* gtk_file_filter_add_pattern()) or on their mime type (with
* gtk_file_filter_add_mime_type()).
*
* Filtering by mime types handles aliasing and subclassing of mime
* types; e.g. a filter for text/plain also matches a file with mime
@ -34,9 +33,10 @@
* text/plain. Note that #GtkFileFilter allows wildcards for the
* subtype of a mime type, so you can e.g. filter for image/\*.
*
* Normally, filters are used by adding them to a #GtkFileChooser,
* see gtk_file_chooser_add_filter(), but it is also possible
* to manually use a filter on a file with gtk_file_filter_filter().
* Normally, file filters are used by adding them to a #GtkFileChooser
* (see gtk_file_chooser_add_filter()), but it is also possible to
* manually use a file filter on any #GtkFilterListModel containing
* #GFileInfo objects.
*
* # GtkFileFilter as GtkBuildable
*
@ -440,11 +440,13 @@ gtk_file_filter_buildable_custom_tag_end (GtkBuildable *buildable,
* gtk_file_filter_new:
*
* Creates a new #GtkFileFilter with no rules added to it.
*
* Such a filter doesnt accept any files, so is not
* particularly useful until you add rules with
* gtk_file_filter_add_mime_type(), gtk_file_filter_add_pattern(),
* or gtk_file_filter_add_custom(). To create a filter
* that accepts any file, use:
* or gtk_file_filter_add_pixbuf_formats().
*
* To create a filter that accepts any file, use:
* |[<!-- language="C" -->
* GtkFileFilter *filter = gtk_file_filter_new ();
* gtk_file_filter_add_pattern (filter, "*");
@ -464,9 +466,9 @@ gtk_file_filter_new (void)
* @name: (allow-none): the human-readable-name for the filter, or %NULL
* to remove any existing name.
*
* Sets the human-readable name of the filter; this is the string
* that will be displayed in the file selector user interface if
* there is a selectable list of filters.
* Sets a human-readable name of the filter; this is the string
* that will be displayed in the file chooser if there is a selectable
* list of filters.
**/
void
gtk_file_filter_set_name (GtkFileFilter *filter,
@ -490,7 +492,7 @@ gtk_file_filter_set_name (GtkFileFilter *filter,
* Gets the human-readable name for the filter. See gtk_file_filter_set_name().
*
* Returns: (nullable): The human-readable name of the filter,
* or %NULL. This value is owned by GTK+ and must not
* or %NULL. This value is owned by GTK and must not
* be modified or freed.
**/
const gchar *
@ -584,6 +586,9 @@ gtk_file_filter_add_pattern (GtkFileFilter *filter,
*
* Adds a rule allowing image files in the formats supported
* by GdkPixbuf.
*
* This is equivalent to calling gtk_file_filter_add_mime_type()
* for all the supported mime types.
**/
void
gtk_file_filter_add_pixbuf_formats (GtkFileFilter *filter)