home · contact · privacy
Browser: Fix "(none)" not getting displayed on selection of dummy items.
authorChristian Heller <c.heller@plomlompom.de>
Mon, 28 Oct 2024 12:56:13 +0000 (13:56 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 28 Oct 2024 12:56:13 +0000 (13:56 +0100)
browser.py

index 91355ed3818cce6a64d363f18c41753f870d21ca..57dc8ab8a58279e80781028b6db3a1ca3445b120 100755 (executable)
@@ -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