summaryrefslogtreecommitdiff
path: root/alot/widgets/search.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-10-06 11:19:13 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2012-10-06 11:19:13 +0100
commit844cec876f21369b8bdcda7911289746e4056b0f (patch)
treea933d4b9aa31bdf379e16d211628fe25291fc9cc /alot/widgets/search.py
parentbbe7b20b3bc528486ba87545104367cd60bc2083 (diff)
fix ThreadlineWidget.refresh()
before, it did not re-read the thread info from the index. This showed when updating the tags for individual threads.
Diffstat (limited to 'alot/widgets/search.py')
-rw-r--r--alot/widgets/search.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/alot/widgets/search.py b/alot/widgets/search.py
index 7a301d81..13789454 100644
--- a/alot/widgets/search.py
+++ b/alot/widgets/search.py
@@ -20,7 +20,8 @@ class ThreadlineWidget(urwid.AttrMap):
"""
def __init__(self, tid, dbman):
self.dbman = dbman
- self.thread = dbman.get_thread(tid)
+ self.tid = tid
+ self.thread = None # will be set by refresh()
self.tag_widgets = []
self.display_content = settings.get('display_content_in_threadline')
self.structure = None
@@ -105,9 +106,7 @@ class ThreadlineWidget(urwid.AttrMap):
msgs.sort(key=lambda msg: msg.get_date(), reverse=True)
lastcontent = ' '.join([m.get_text_content() for m in msgs])
contentstring = pad(lastcontent.replace('\n', ' ').strip())
- content_w = AttrFlipWidget(urwid.Text(
- contentstring,
- wrap='clip'),
+ content_w = AttrFlipWidget(urwid.Text(contentstring, wrap='clip'),
struct['content'])
width = len(contentstring)
part = content_w
@@ -135,6 +134,7 @@ class ThreadlineWidget(urwid.AttrMap):
return width, part
def rebuild(self):
+ self.thread = self.dbman.get_thread(self.tid)
self.widgets = []
columns = []
self.structure = settings.get_threadline_theming(self.thread)