[glib: 17/26] gfileinfo: Stop using deprecated GTimeVal



commit 161654681f6029209bd117a6f5f468b18fc6230b
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Jul 24 14:08:53 2019 +0100

    gfileinfo: Stop using deprecated GTimeVal
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Helps: #1438

 gio/gfileinfo.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gio/gfileinfo.c b/gio/gfileinfo.c
index 24ae903f5..8c1d6c67f 100644
--- a/gio/gfileinfo.c
+++ b/gio/gfileinfo.c
@@ -1464,7 +1464,8 @@ g_file_info_get_deletion_date (GFileInfo *info)
   static guint32 attr = 0;
   GFileAttributeValue *value;
   const char *date_str;
-  GTimeVal tv;
+  GTimeZone *local_tz = NULL;
+  GDateTime *dt = NULL;
 
   g_return_val_if_fail (G_IS_FILE_INFO (info), FALSE);
 
@@ -1476,10 +1477,11 @@ g_file_info_get_deletion_date (GFileInfo *info)
   if (!date_str)
     return NULL;
 
-  if (g_time_val_from_iso8601 (date_str, &tv) == FALSE)
-    return NULL;
+  local_tz = g_time_zone_new_local ();
+  dt = g_date_time_new_from_iso8601 (date_str, local_tz);
+  g_time_zone_unref (local_tz);
 
-  return g_date_time_new_from_timeval_local (&tv);
+  return g_steal_pointer (&dt);
 }
 
 /**


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