home · contact · privacy
Preverse previous sort order where new one would not make a difference.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 24 Aug 2024 05:58:49 +0000 (07:58 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 24 Aug 2024 05:58:49 +0000 (07:58 +0200)
browser.py

index f2886261394dec2ac86efc788e6436641f677999..3d43d05ad8729709713289de5f0b17d88f0f92bc 100755 (executable)
@@ -133,8 +133,8 @@ class Window(Gtk.ApplicationWindow):
 
     def sort(self, attr_name):
         self.list_store.remove_all()
-        for file_item in sorted(self.unsorted,
-                                key=lambda i: getattr(i, attr_name)):
+        self.unsorted.sort(key=lambda i: getattr(i, attr_name))
+        for file_item in self.unsorted:
             self.list_store.append(file_item)
         self.update_selected()