gio: Fix querying of thumbnail attributes other than thumbnail::path

The thumbnail attributes would previously only be set if thumbnail::path
was included in the query — so querying for just thumbnail::is-valid
would return no results.

This fixes the behaviour of
    gio info -a thumbnail::is-valid ./some-file.png
vs
    gio info -a thumbnail ./some-file.png

The first command would previously list nothing. The second would
previously list a thumbnail::path and thumbnail::is-valid.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=791325
This commit is contained in:
Philip Withnall 2017-12-07 10:21:35 +00:00
parent ed3d2d9c67
commit 62dece198b

View File

@ -1981,7 +1981,11 @@ _g_local_file_info_get (const char *basename,
get_xattrs (path, FALSE, info, attribute_matcher, (flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) == 0);
if (_g_file_attribute_matcher_matches_id (attribute_matcher,
G_FILE_ATTRIBUTE_ID_THUMBNAIL_PATH))
G_FILE_ATTRIBUTE_ID_THUMBNAIL_PATH) ||
_g_file_attribute_matcher_matches_id (attribute_matcher,
G_FILE_ATTRIBUTE_ID_THUMBNAIL_IS_VALID) ||
_g_file_attribute_matcher_matches_id (attribute_matcher,
G_FILE_ATTRIBUTE_ID_THUMBNAILING_FAILED))
{
if (stat_ok)
get_thumbnail_attributes (path, info, &statbuf);