mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
gfileinfo: Stop using deprecated GTimeVal
Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: #1438
This commit is contained in:
parent
def5db23a3
commit
161654681f
@ -1464,7 +1464,8 @@ g_file_info_get_deletion_date (GFileInfo *info)
|
|||||||
static guint32 attr = 0;
|
static guint32 attr = 0;
|
||||||
GFileAttributeValue *value;
|
GFileAttributeValue *value;
|
||||||
const char *date_str;
|
const char *date_str;
|
||||||
GTimeVal tv;
|
GTimeZone *local_tz = NULL;
|
||||||
|
GDateTime *dt = NULL;
|
||||||
|
|
||||||
g_return_val_if_fail (G_IS_FILE_INFO (info), FALSE);
|
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)
|
if (!date_str)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (g_time_val_from_iso8601 (date_str, &tv) == FALSE)
|
local_tz = g_time_zone_new_local ();
|
||||||
return NULL;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user