From: Christian Heller Date: Mon, 28 Oct 2024 12:56:13 +0000 (+0100) Subject: Browser: Fix "(none)" not getting displayed on selection of dummy items. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/task?a=commitdiff_plain;h=a5ed04e44010e2fa4d199f7127cd4918bdc44e3c;p=stable_plom Browser: Fix "(none)" not getting displayed on selection of dummy items. --- diff --git a/browser.py b/browser.py index 91355ed..57dc8ab 100755 --- a/browser.py +++ b/browser.py @@ -1171,7 +1171,6 @@ class MainWindow(Gtk.Window): selected_item = self.gallery.selected_item display_name = '(none)' if selected_item: - display_name = selected_item.full_path if isinstance(selected_item, ImgItem): params_strs = [f'{k}: {getattr(selected_item, k.lower())}' for k in GEN_PARAMS] @@ -1179,6 +1178,9 @@ class MainWindow(Gtk.Window): bookmarked = 'BOOKMARK' if selected_item.bookmarked else '' self.metadata.set_text( '\n'.join([title, bookmarked] + params_strs)) + display_name = selected_item.full_path + elif isinstance(selected_item, DirItem): + display_name = selected_item.full_path total = len([s for s in self.gallery.slots if isinstance(s.item, (DirItem, ImgItem))]) n_selected = self.gallery.selected_idx + 1