summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-03-18 00:34:44 +0100
committerraveit65 <[email protected]>2020-05-24 22:03:53 +0200
commitf1ee07d309bb099a20abe591f8ac505652232317 (patch)
treec44a01ac40b8d18192cf15410616c684640c5593 /libcaja-private
parentfabef040693ed0b84a514465b82e6559023e0f17 (diff)
downloadcaja-f1ee07d309bb099a20abe591f8ac505652232317.tar.bz2
caja-f1ee07d309bb099a20abe591f8ac505652232317.tar.xz
caja-file: remove warning GTimeVal is deprecated
Diffstat (limited to 'libcaja-private')
-rw-r--r--libcaja-private/caja-file.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
index c32e07c4..acf31926 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;