From 4e4de473262b611ded80f3b39a5dd27ad729c4f1 Mon Sep 17 00:00:00 2001 From: Kai Willadsen Date: Fri, 5 Apr 2024 08:35:59 +1000 Subject: [PATCH] Remove workaround for old pygobject issue --- README.md | 2 +- meld/ui/pathlabel.py | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 69ce217e..9f56568b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Requirements * Python 3.6 * pycairo (Python3 bindings for cairo without GObject layer) -* PyGObject 3.30 (Python3 bindings for GObject introspection) +* PyGObject 3.36 (Python3 bindings for GObject introspection) * gsettings-desktop-schemas And following packages with GObject introspection: diff --git a/meld/ui/pathlabel.py b/meld/ui/pathlabel.py index 3a2c07f5..c0b71eea 100644 --- a/meld/ui/pathlabel.py +++ b/meld/ui/pathlabel.py @@ -146,6 +146,11 @@ def __init__(self, *args, **kwargs): GObject.BindingFlags.DEFAULT | GObject.BindingFlags.SYNC_CREATE, self.get_display_label, ) + self.bind_property( + 'gfile', self.full_path_label, 'text', + GObject.BindingFlags.DEFAULT | GObject.BindingFlags.SYNC_CREATE, + self.get_display_path, + ) action_group = Gio.SimpleActionGroup() @@ -164,17 +169,6 @@ def __init__(self, *args, **kwargs): # prop changes, so we need this notify callback. self.connect('notify::label', self.label_changed_cb) - def do_realize(self): - # As a workaround for pygobject#341, we delay this binding until - # realize, at which point the child object is correct. - self.bind_property( - 'gfile', self.full_path_label, 'text', - GObject.BindingFlags.DEFAULT | GObject.BindingFlags.SYNC_CREATE, - self.get_display_path, - ) - - return Gtk.MenuButton.do_realize(self) - def label_changed_cb(self, *args): # Our label needs ellipsization to avoid forcing minimum window # sizes for long filenames. This child iteration hack is