diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 6853a3471..e6a1bf9b9 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -10409,26 +10409,12 @@ file_system_model_set (GtkFileSystemModel *model, if (info == NULL) break; -/* GLib 2.62 replaced the old GTimeVal API with GDateTime. */ -#if GLIB_CHECK_VERSION (2, 62, 0) - { - GDateTime *dt; - - dt = g_file_info_get_modification_date_time (info); - if (dt) - { - tv = g_date_time_to_unix (dt); - g_date_time_unref (dt); - } - } -#else - { - GTimeVal timeval; - - g_file_info_get_modification_time (info, &timeval); - tv = timeval.tv_sec; - } -#endif + /* The seconds as GIO keeps them, 64 bits on all systems: not + * the GTimeVal of older GLib, whose glong ends in 2038 on 32-bit + * systems and on Windows, and no GDateTime made for every cell + * drawn. GIO puts st_mtime into a uint64; read as signed, a + * time before 1970 comes back as it was. */ + tv = (gint64) g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED); if (column == MODEL_COL_MTIME) g_value_set_int64 (value, tv);