Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2022-10-02 21:57:36 +0300
committerPhilipp Hörist <philipp@hoerist.com>2022-10-02 21:57:36 +0300
commit447c9d515a305f1d197e63be7c3abb41e7736d8a (patch)
tree37f642e2fda080e8d5f1ecfc4a0d68b168a77e7a
parent84008836fb40cf1a12f766a88d90dd46f0dda163 (diff)
refactor: ChatList: Simplify update time callback
-rw-r--r--gajim/gtk/chat_list.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/gajim/gtk/chat_list.py b/gajim/gtk/chat_list.py
index ee79c338e..22b122a12 100644
--- a/gajim/gtk/chat_list.py
+++ b/gajim/gtk/chat_list.py
@@ -99,7 +99,7 @@ class ChatList(Gtk.ListBox, EventHelper):
self.connect('drag-data-received', self._on_drag_data_received)
self.connect('destroy', self._on_destroy)
- self._timer_id = GLib.timeout_add_seconds(60, self._update_timer)
+ self._timer_id = GLib.timeout_add_seconds(60, self._update_time)
self.show_all()
@@ -242,8 +242,9 @@ class ChatList(Gtk.ListBox, EventHelper):
def _on_destroy(self, _widget: Gtk.Widget) -> None:
GLib.source_remove(self._timer_id)
- def _update_timer(self) -> bool:
- self.update_time()
+ def _update_time(self) -> bool:
+ for _key, row in self._chats.items():
+ row.update_time()
return True
def _filter_func(self, row: ChatListRow) -> bool:
@@ -491,10 +492,6 @@ class ChatList(Gtk.ListBox, EventHelper):
'position': row.position})
return open_chats
- def update_time(self) -> None:
- for _key, row in self._chats.items():
- row.update_time()
-
def process_event(self, event: events.ChatListEventT) -> None:
if isinstance(event, (events.MessageReceived,
events.MamMessageReceived,