filechooserwidget: Fix time_sort_func
authorCorey Berla <corey@berla.me>
Wed, 19 Oct 2022 20:57:20 +0000 (13:57 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 21 Oct 2022 02:34:41 +0000 (22:34 -0400)
gtk/gtkfilechooserwidget.c

index c2890450904167fb83ae0051677448c2a8053a2a..993a316076b34b9a148f391d1d38ce046d6a8932 100644 (file)
@@ -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;