From b7370e42cdc877c39e74e6932b6ae6bf8e1e09f6 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 13 May 2021 16:29:59 +0200 Subject: buffers/thread: do not access message widgets unnecessarily Avoids constructing the widgets when we only need the messages. --- alot/buffers/thread.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/alot/buffers/thread.py b/alot/buffers/thread.py index 33405be4..744eab22 100644 --- a/alot/buffers/thread.py +++ b/alot/buffers/thread.py @@ -275,22 +275,22 @@ class ThreadBuffer(Buffer): raise ValueError('Invalid focus_propery direction: ' + str(direction)) for pos in walk: - if prop(self._messages[pos].wgt): + if prop(self._messages[pos]): self.set_focus(pos) break def focus_next_matching(self, querystring): """focus next matching message in depth first order""" - self._focus_property(lambda x: x.get_message().matches(querystring), self._DIR_NEXT) + self._focus_property(lambda x: x.msg.matches(querystring), self._DIR_NEXT) def focus_prev_matching(self, querystring): """focus previous matching message in depth first order""" - self._focus_property(lambda x: x.get_message().matches(querystring), self._DIR_PREV) + self._focus_property(lambda x: x.msg.matches(querystring), self._DIR_PREV) def focus_first_matching(self, querystring): """focus first matching message in depth first order""" - self._focus_property(lambda x: x.get_message().matches(querystring), self._DIR_FIRST) + self._focus_property(lambda x: x.msg.matches(querystring), self._DIR_FIRST) def focus_last_matching(self, querystring): """focus last matching message in depth first order""" - self._focus_property(lambda x: x.get_message().matches(querystring), self._DIR_LAST) + self._focus_property(lambda x: x.msg.matches(querystring), self._DIR_LAST) def focus_thread_widget(self): """set focus on the thread widget""" -- cgit v1.2.3