summaryrefslogtreecommitdiff
path: root/logview/src
diff options
context:
space:
mode:
authortamplan <[email protected]>2020-05-19 11:41:29 +0200
committerGitHub <[email protected]>2020-05-19 11:41:29 +0200
commit56ee1af7bd37178febe46c2c87c579de0fc5553c (patch)
treee4c4a8e49f38d3eaf621d54c8bdc79e5b9eda5a7 /logview/src
parentab05cf124424df39975b60ad9115f6cd15678dc2 (diff)
downloadmate-utils-56ee1af7bd37178febe46c2c87c579de0fc5553c.tar.bz2
mate-utils-56ee1af7bd37178febe46c2c87c579de0fc5553c.tar.xz
mate-system-log: Remove the warning about ‘GTimeVal’ is deprecated
Diffstat (limited to 'logview/src')
-rw-r--r--logview/src/logview-log.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/logview/src/logview-log.c b/logview/src/logview-log.c
index 13f9df32..0e996fd1 100644
--- a/logview/src/logview-log.c
+++ b/logview/src/logview-log.c
@@ -609,7 +609,6 @@ log_load (GIOSchedulerJob *io_job,
const char *content_type;
GFileType type;
GError *err = NULL;
- GTimeVal timeval;
gboolean is_archive, can_read;
info = g_file_query_info (f,
@@ -654,8 +653,19 @@ log_load (GIOSchedulerJob *io_job,
}
log->priv->file_size = g_file_info_get_size (info);
- g_file_info_get_modification_time (info, &timeval);
- log->priv->file_time = timeval.tv_sec;
+ #if GLIB_CHECK_VERSION(2,61,2)
+ GDateTime *file_dt;
+ gint64 t;
+ file_dt = g_file_info_get_modification_date_time (info);
+ t = g_date_time_to_unix (file_dt);
+ g_date_time_unref (file_dt);
+ log->priv->file_time = t;
+ #else
+ GTimeVal time_val;
+ g_file_info_get_modification_time (info, &time_val);
+ log->priv->file_time = time_val.tv_sec;
+ #endif
+
log->priv->display_name = g_strdup (g_file_info_get_display_name (info));
g_object_unref (info);