mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-03 16:03:40 +02:00
file-info: Add a G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID attribute
This indicates whether the thumbnail (given by G_FILE_ATTRIBUTE_THUMBNAIL_PATH) is valid — i.e. to represent the file in its current state. If G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID is FALSE (for a normal _or_ failed thumbnail) it means the file has changed since the thumbnail was generated, and the thumbnail is out of date. Part of checking thumbnail validity (by the spec) involves parsing headers out of the thumbnail .png so we include some (small) code to do that in a separate file. We will likely want to copy this code to gvfs to do the same for GVfsFile. Heavily based on a patch from Philip Withnall <philip.withnall@collabora.co.uk> who suggested the feature and designed the API. https://bugzilla.gnome.org/show_bug.cgi?id=709898
This commit is contained in:
@@ -703,6 +703,21 @@ typedef struct _GFileInfoClass GFileInfoClass;
|
||||
* #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
|
||||
**/
|
||||
#define G_FILE_ATTRIBUTE_THUMBNAILING_FAILED "thumbnail::failed" /* boolean */
|
||||
/**
|
||||
* G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID:
|
||||
*
|
||||
* A key in the "thumbnail" namespace for checking whether the thumbnail is outdated.
|
||||
* This attribute is %TRUE if the thumbnail is up-to-date with the file it represents,
|
||||
* and %FALSE if the file has been modified since the thumbnail was generated.
|
||||
*
|
||||
* If %G_FILE_ATTRIBUTE_THUMBNAILING_FAILED is %TRUE and this attribute is %FALSE,
|
||||
* it indicates that thumbnailing may be attempted again and may succeed.
|
||||
*
|
||||
* Corresponding #GFileAttributeType is %G_FILE_ATTRIBUTE_TYPE_BOOLEAN.
|
||||
*
|
||||
* Since: 2.40
|
||||
*/
|
||||
#define G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID "thumbnail::is-valid" /* boolean */
|
||||
|
||||
/* Preview */
|
||||
|
||||
|
Reference in New Issue
Block a user