diff options
author | rbuj <[email protected]> | 2020-03-18 00:34:44 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-21 17:32:27 +0200 |
commit | 45527582fc8b6a510407e02ae4b29bb44a52d010 (patch) | |
tree | b67646b6f6c10921d59410835be355bbb2282051 /libcaja-private/caja-file.c | |
parent | 3bdffc9a6f5c53e87c333a946a16e66ad0a40347 (diff) | |
download | caja-45527582fc8b6a510407e02ae4b29bb44a52d010.tar.bz2 caja-45527582fc8b6a510407e02ae4b29bb44a52d010.tar.xz |
caja-file: remove warning GTimeVal is deprecated
Diffstat (limited to 'libcaja-private/caja-file.c')
-rw-r--r-- | libcaja-private/caja-file.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index 5336851e..69e2b665 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -2113,7 +2113,6 @@ update_info_internal (CajaFile *file, int sort_order; time_t atime, mtime, ctime; time_t trash_time; - GTimeVal g_trash_time; const char * time_string; const char *symlink_name, *mime_type, *selinux_context, *thumbnail_path; GFileType file_type; @@ -2489,8 +2488,21 @@ update_info_internal (CajaFile *file, trash_time = 0; time_string = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_TRASH_DELETION_DATE); if (time_string != NULL) { +#if GLIB_CHECK_VERSION(2,61,2) + GDateTime *dt; + GTimeZone *tz; + tz = g_time_zone_new_local (); + dt = g_date_time_new_from_iso8601 (time_string, tz); + if (dt) { + trash_time = (time_t) g_date_time_to_unix (dt); + g_date_time_unref (dt); + } + g_time_zone_unref (tz); +#else + GTimeVal g_trash_time; g_time_val_from_iso8601 (time_string, &g_trash_time); trash_time = g_trash_time.tv_sec; +#endif } if (file->details->trash_time != trash_time) { changed = TRUE; |