Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
1d2dff87 by wurstsalat at 2025-01-31T23:28:24+01:00
cq: ServiceDiscovery: Remove obsolete code

- - - - -
58ef9e02 by wurstsalat at 2025-01-31T23:28:50+01:00
cq: Util: Remove obsolete methods

- - - - -


2 changed files:

- gajim/gtk/discovery.py
- gajim/gtk/util.py


Changes:

=====================================
gajim/gtk/discovery.py
=====================================
@@ -1207,8 +1207,6 @@ def _agent_items(
         # We got a list of items
         def fill_partial_rows(items: list[DiscoItem]) -> Iterator[bool]:
             """Generator to fill the listmodel of a treeview progressively."""
-            # TODO GTK4
-            # self.window.services_treeview.freeze_child_notify()
             for item in items:
                 if self.window.dying:
                     yield False
@@ -1220,10 +1218,7 @@ def fill_partial_rows(items: list[DiscoItem]) -> 
Iterator[bool]:
                 self._total_items += 1
                 self._add_item(node, item, force)
                 if (self._total_items % 10) == 0:
-                    # self.window.services_treeview.thaw_child_notify()
                     yield True
-                    # self.window.services_treeview.freeze_child_notify()
-            # self.window.services_treeview.thaw_child_notify()
             # Stop idle_add()
             yield False
 


=====================================
gajim/gtk/util.py
=====================================
@@ -992,47 +992,6 @@ def get_gtk_version() -> str:
     )
 
 
-def _connect_destroy(
-    sender: Any,
-    func: Any,
-    detailed_signal: str,
-    handler: Any,
-    *args: Any,
-    **kwargs: Any,
-) -> int:
-    """Connect a bound method to a foreign object signal and disconnect
-    if the object the method is bound to emits destroy (Gtk.Widget subclass).
-    Also works if the handler is a nested function in a method and
-    references the method's bound object.
-    This solves the problem that the sender holds a strong reference
-    to the bound method and the bound to object doesn't get GCed.
-    """
-    # TODO GTK4: keep and adapt?
-
-    if hasattr(handler, "__self__"):
-        obj = handler.__self__
-    else:
-        # XXX: get the "self" var of the enclosing scope.
-        # Used for nested functions which ref the object but aren't methods.
-        # In case they don't ref "self" normal connect() should be used anyway.
-        index = handler.__code__.co_freevars.index("self")
-        obj = handler.__closure__[index].cell_contents
-
-    assert obj is not sender
-
-    handler_id = func(detailed_signal, handler, *args, **kwargs)
-
-    def disconnect_cb(*args: Any) -> None:
-        sender.disconnect(handler_id)
-
-    obj.connect("destroy", disconnect_cb)
-    return handler_id
-
-
-def connect_destroy(sender: Any, *args: Any, **kwargs: Any) -> int:
-    return _connect_destroy(sender, sender.connect, *args, **kwargs)
-
-
 class GroupBadge(Gtk.Label):
     def __init__(self, group: str) -> None:
         Gtk.Label.__init__(



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/9dea728472c62fbd2c419ff289f3e559929846db...58ef9e026eec5d31ea6683ab8a02e52bb1351ce0

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/9dea728472c62fbd2c419ff289f3e559929846db...58ef9e026eec5d31ea6683ab8a02e52bb1351ce0
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to