Skip to content

Commit

Permalink
Switch to 64 bit time formatting for sorting
Browse files Browse the repository at this point in the history
Fixes #194
  • Loading branch information
phillipberndt committed Jan 2, 2024
1 parent 251ef34 commit fed07e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pqiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1769,9 +1769,10 @@ void load_images_handle_parameter(char *param, load_images_state_t state, gint d
if(param_file) {
GFileInfo *file_info = g_file_query_info(param_file, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, NULL);
if(file_info) {
#if GLIB_CHECK_VERSION(2, 62, 0)
#if GLIB_CHECK_VERSION(2, 62, 0) && !defined(_WIN32)
// Note: _WIN32 check might not be needed, G_GINT64_FORMAT used to be unsupported in MingW
GDateTime *result = g_file_info_get_modification_date_time(file_info);
file->sort_name = g_strdup_printf("%zu;%s", g_date_time_to_unix(result), file->display_name);
file->sort_name = g_strdup_printf("%" G_GINT64_FORMAT ";%s", g_date_time_to_unix(result), file->display_name);
g_date_time_unref(result);
#else
GTimeVal result;
Expand Down

0 comments on commit fed07e8

Please sign in to comment.