diff options
author | rbuj <[email protected]> | 2020-04-03 14:29:53 +0200 |
---|---|---|
committer | Robert Antoni Buj Gelonch <[email protected]> | 2020-06-16 19:51:24 +0200 |
commit | 3cf85f7d96c4e9d2d03f1a389a5062caa42386c9 (patch) | |
tree | 57756b401e59c107c42c3306e354a8fd86a0ee68 /gsearchtool/src/gsearchtool.c | |
parent | 36875203bdfc21bbe79a50ab58aae913b0280c91 (diff) | |
download | mate-utils-3cf85f7d96c4e9d2d03f1a389a5062caa42386c9.tar.bz2 mate-utils-3cf85f7d96c4e9d2d03f1a389a5062caa42386c9.tar.xz |
gsearchtool: Remove the warning about ‘GTimeVal’ is deprecated
Diffstat (limited to 'gsearchtool/src/gsearchtool.c')
-rw-r--r-- | gsearchtool/src/gsearchtool.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gsearchtool/src/gsearchtool.c b/gsearchtool/src/gsearchtool.c index 964e7f4c..bdc1561a 100644 --- a/gsearchtool/src/gsearchtool.c +++ b/gsearchtool/src/gsearchtool.c @@ -840,7 +840,12 @@ add_file_to_search_results (const gchar * file, GFileInfo * file_info; GFile * g_file; GError * error = NULL; + GDateTime * file_dt; +#if GLIB_CHECK_VERSION(2,61,2) + gint64 time_val; +#else GTimeVal time_val; +#endif GtkTreePath * path; GtkTreeRowReference * reference; gchar * description; @@ -875,8 +880,14 @@ add_file_to_search_results (const gchar * file, description = get_file_type_description (file, file_info); readable_size = g_format_size (g_file_info_get_size (file_info)); +#if GLIB_CHECK_VERSION(2,61,2) + file_dt = g_file_info_get_modification_date_time (file_info); + time_val = g_date_time_to_unix (file_dt); +#else g_file_info_get_modification_time (file_info, &time_val); - readable_date = get_readable_date (gsearch->search_results_date_format, time_val.tv_sec); + file_dt = g_date_time_new_from_unix_local ((gint64) time_val.tv_sec); +#endif + readable_date = get_readable_date (gsearch->search_results_date_format, file_dt); base_name = g_path_get_basename (file); dir_name = g_path_get_dirname (file); @@ -915,7 +926,11 @@ add_file_to_search_results (const gchar * file, COLUMN_SIZE, (-1) * (gdouble) file_size, COLUMN_TYPE, (description != NULL) ? description : g_strdup (g_file_info_get_content_type (file_info)), COLUMN_READABLE_DATE, readable_date, +#if GLIB_CHECK_VERSION(2,61,2) + COLUMN_DATE, (-1) * (gdouble) time_val, +#else COLUMN_DATE, (-1) * (gdouble) time_val.tv_sec, +#endif COLUMN_NO_FILES_FOUND, FALSE, -1); @@ -946,6 +961,7 @@ add_file_to_search_results (const gchar * file, g_object_unref (g_file); g_object_unref (file_info); + g_date_time_unref (file_dt); g_free (base_name); g_free (dir_name); g_free (relative_dir_name); |