diff options
| author | Corey Berla <corey@berla.me> | 2022-10-19 13:57:20 -0700 |
|---|---|---|
| committer | Matthias Clasen <mclasen@redhat.com> | 2022-10-20 22:34:41 -0400 |
| commit | 71adb26a0d7f378136a80a1695c7d50cd4e10fb8 (patch) | |
| tree | 1d955de0696a5b0156ba9089d7e8fecaf18641f9 | |
| parent | e27fa336900482c753e088f6eca720912db24d40 (diff) | |
| download | gtk+-71adb26a0d7f378136a80a1695c7d50cd4e10fb8.tar.gz | |
filechooserwidget: Fix time_sort_func
| -rw-r--r-- | gtk/gtkfilechooserwidget.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index c289045090..993a316076 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -7003,9 +7003,17 @@ time_sort_func (gconstpointer a, glong time_a, time_b; if (impl->operation_mode == OPERATION_MODE_RECENT) - time_a = (glong) g_file_info_get_attribute_uint64 ((GFileInfo *)a, G_FILE_ATTRIBUTE_TIME_ACCESS); + { + time_a = (glong) g_file_info_get_attribute_uint64 ((GFileInfo *)a, G_FILE_ATTRIBUTE_TIME_ACCESS); + time_b = (glong) g_file_info_get_attribute_uint64 ((GFileInfo *)b, G_FILE_ATTRIBUTE_TIME_ACCESS); + } + else - time_b = (glong) g_file_info_get_attribute_uint64 ((GFileInfo *)b, G_FILE_ATTRIBUTE_TIME_MODIFIED); + { + time_a = (glong) g_file_info_get_attribute_uint64 ((GFileInfo *)a, G_FILE_ATTRIBUTE_TIME_MODIFIED); + time_b = (glong) g_file_info_get_attribute_uint64 ((GFileInfo *)b, G_FILE_ATTRIBUTE_TIME_MODIFIED); + } + if (time_a < time_b) return GTK_ORDERING_SMALLER; |
