From: Christian Heller Date: Mon, 9 Sep 2024 14:46:27 +0000 (+0200) Subject: browser.py: Minor fix and optimization in .update_gallery. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/balance2?a=commitdiff_plain;h=ca74e005ef5ef2d96fad405b4ba21e905724ed2c;p=stable_plom browser.py: Minor fix and optimization in .update_gallery. --- diff --git a/browser.py b/browser.py index b1bcc3a..33791a6 100755 --- a/browser.py +++ b/browser.py @@ -262,6 +262,8 @@ class MainWindow(Gtk.Window): return True if a_cmp is None: return False + elif b_cmp is None: + return True return a_cmp > b_cmp def init_gallery_slot(file_item): @@ -276,9 +278,10 @@ class MainWindow(Gtk.Window): slot.append(slot.content) return slot - self.gallery.bind_model(self.gallery_selection, init_gallery_slot) + self.gallery.bind_model(None, lambda _: Gtk.Box()) if sort: self.gallery_store.sort(sorter) + self.gallery.bind_model(self.gallery_selection, init_gallery_slot) to_select = self.gallery.get_child_at_index(0) if suggested_selection: i = 0