[meld/pathlabel] ui.pathlabel: Use the plain descendent file as label when missing parent
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/pathlabel] ui.pathlabel: Use the plain descendent file as label when missing parent
- Date: Sat, 16 Jan 2021 22:47:33 +0000 (UTC)
commit 9e18903b4381fc17a27b40f5fbac5e30e0179aab
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Jan 17 07:41:26 2021 +1000
ui.pathlabel: Use the plain descendent file as label when missing parent
meld/ui/pathlabel.py | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/meld/ui/pathlabel.py b/meld/ui/pathlabel.py
index e04f8768..ff9a532f 100644
--- a/meld/ui/pathlabel.py
+++ b/meld/ui/pathlabel.py
@@ -158,6 +158,12 @@ class PathLabel(Gtk.MenuButton):
if not parent or not descendant:
self._parent_gfile = parent
self._gfile = descendant
+
+ # If we have no parent yet but have a descendant, we'll use
+ # the descendant name as the better-than-nothing label.
+ if descendant:
+ self._path_label = descendant.get_parse_name()
+ self.notify('path_label')
return
descendant_parent = descendant.get_parent()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]