[gtk/gbsneto/filechooser-column-view] filechooserwidget: Fix time_sort_func



commit fec77a2be189ce9f03db45f2db93a2aba92975c9
Author: Corey Berla <corey berla me>
Date:   Wed Oct 19 13:57:20 2022 -0700

    filechooserwidget: Fix time_sort_func

 gtk/gtkfilechooserwidget.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 8308d1a3c9..267f937d84 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -6944,9 +6944,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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]