summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2019-08-13 15:00:30 +0300
committerSeonah Moon <seonah1.moon@samsung.com>2020-02-04 21:07:01 +0900
commit3195cca9fe9d76b9b1c9269fb0f06e6f39d95275 (patch)
treefd5b2936937a35495726bd7c61e1a1b0d14a4f1f
parentaa4ed701e31823b4a1524552ffcdd6ceca01fa78 (diff)
downloadlibsoup-3195cca9fe9d76b9b1c9269fb0f06e6f39d95275.tar.gz
libsoup-3195cca9fe9d76b9b1c9269fb0f06e6f39d95275.tar.bz2
libsoup-3195cca9fe9d76b9b1c9269fb0f06e6f39d95275.zip
SoupDirectoryInputStream: Remove deprecated use of GTimeVal
The API needed here is new in 2.61.2, so use it conditionally. https://gitlab.gnome.org/GNOME/libsoup/commit/e852f4a037d9556063447d3f617f0225f8306f48 Change-Id: Ia68aeecd10f4f058e3fe2d3f93ed9f6f00ce9747
-rw-r--r--libsoup/soup-directory-input-stream.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libsoup/soup-directory-input-stream.c b/libsoup/soup-directory-input-stream.c
index eb8228a3..e0ccfd90 100644
--- a/libsoup/soup-directory-input-stream.c
+++ b/libsoup/soup-directory-input-stream.c
@@ -42,7 +42,9 @@ soup_directory_input_stream_parse_info (SoupDirectoryInputStream *stream,
GString *string;
const char *file_name;
char *escaped, *path, *xml_string, *size, *time;
+#if !GLIB_CHECK_VERSION (2, 61, 2)
GTimeVal modified;
+#endif
GDateTime *modification_time;
if (!g_file_info_get_name (info))
@@ -61,8 +63,12 @@ soup_directory_input_stream_parse_info (SoupDirectoryInputStream *stream,
escaped = g_uri_escape_string (file_name, NULL, FALSE);
path = g_strconcat (stream->uri, G_DIR_SEPARATOR_S, escaped, NULL);
size = g_format_size (g_file_info_get_size (info));
+#if GLIB_CHECK_VERSION (2, 61, 2)
+ modification_time = g_file_info_get_modification_date_time (info);
+#else
g_file_info_get_modification_time (info, &modified);
modification_time = g_date_time_new_from_timeval_local (&modified);
+#endif
time = g_date_time_format (modification_time, "%X %x");
g_date_time_unref (modification_time);