Skip to content

Commit

Permalink
Remove workaround for old pygobject issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiw committed Apr 4, 2024
1 parent 0effe53 commit 4e4de47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 5 additions & 11 deletions meld/ui/pathlabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
Expand Down

0 comments on commit 4e4de47

Please sign in to comment.