summaryrefslogtreecommitdiff
path: root/src/nautilus-vfs-file.c
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2020-08-22 11:04:26 +0100
committerOndrej Holy <oholy@redhat.com>2021-01-05 14:03:48 +0000
commit99d034af6cceb6a170c9022f3261cfcb3a6cade0 (patch)
tree5148f84e425d0bf1a2f07347eec9bcda9cf0be5b /src/nautilus-vfs-file.c
parent39e05c23687b9af2cac6fc982b2f90aadb2a9c95 (diff)
downloadnautilus-99d034af6cceb6a170c9022f3261cfcb3a6cade0.tar.gz
file: Add "date_created" attribute
GIO 2.66 introduces support for Linux statx stx_btime.[0] First, let's add support for this attribute in our file models. No user-visible changes yet. [0] https://gitlab.gnome.org/GNOME/glib/-/commit/a396fa9027bf9aaab0697789fe38efec53b09431
Diffstat (limited to 'src/nautilus-vfs-file.c')
-rw-r--r--src/nautilus-vfs-file.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nautilus-vfs-file.c b/src/nautilus-vfs-file.c
index 66dff20a2..ccbbc3536 100644
--- a/src/nautilus-vfs-file.c
+++ b/src/nautilus-vfs-file.c
@@ -225,11 +225,13 @@ vfs_file_get_date (NautilusFile *file,
{
time_t atime;
time_t mtime;
+ time_t btime;
time_t recency;
time_t trash_time;
atime = nautilus_file_get_atime (file);
mtime = nautilus_file_get_mtime (file);
+ btime = nautilus_file_get_btime (file);
recency = nautilus_file_get_recency (file);
trash_time = nautilus_file_get_trash_time (file);
@@ -263,6 +265,20 @@ vfs_file_get_date (NautilusFile *file,
return TRUE;
}
+ case NAUTILUS_DATE_TYPE_CREATED:
+ {
+ /* Before we have info on a file, the date is unknown. */
+ if (btime == 0)
+ {
+ return FALSE;
+ }
+ if (date != NULL)
+ {
+ *date = btime;
+ }
+ return TRUE;
+ }
+
case NAUTILUS_DATE_TYPE_TRASHED:
{
/* Before we have info on a file, the date is unknown. */