[glib] gio: Fix querying of thumbnail attributes other than thumbnail::path



commit 62dece198b7e1734e8455a61e4d43950d6653b33
Author: Philip Withnall <withnall endlessm com>
Date:   Thu Dec 7 10:21:35 2017 +0000

    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

 gio/glocalfileinfo.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
index f0c99df..75169d6 100644
--- a/gio/glocalfileinfo.c
+++ b/gio/glocalfileinfo.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]