summaryrefslogtreecommitdiff
path: root/alot/buffers
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-01-28 14:42:45 +0100
committerAnton Khirnov <anton@khirnov.net>2020-02-03 13:00:02 +0100
commitebc76b4e64dee0d83c08dbc2b38ba63ac748c8dc (patch)
treeb57387f7e0f6412d68a57e38d675e01b8dfd64d0 /alot/buffers
parent7fb73854b70b38a6da884d1e3a0157ae2f1c0698 (diff)
search: add thread_count info property
Diffstat (limited to 'alot/buffers')
-rw-r--r--alot/buffers/search.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/alot/buffers/search.py b/alot/buffers/search.py
index 203ef483..8e58de8a 100644
--- a/alot/buffers/search.py
+++ b/alot/buffers/search.py
@@ -25,20 +25,23 @@ class SearchBuffer(Buffer):
default_order = settings.get('search_threads_sort_order')
self.sort_order = sort_order or default_order
self.result_count = 0
+ self.thread_count = 0
self.isinitialized = False
self.proc = None # process that fills our pipe
self.rebuild()
Buffer.__init__(self, ui, self.body)
def __str__(self):
- formatstring = '[search] for "%s" (%d message%s)'
- return formatstring % (self.querystring, self.result_count,
- 's' if self.result_count > 1 else '')
+ formatstring = '[search] for "%s" (%d message%s in %d thread%s)'
+ return formatstring % (self.querystring,
+ self.result_count, 's' if self.result_count > 1 else '',
+ self.thread_count, 's' if self.thread_count > 1 else '')
def get_info(self):
info = {}
info['querystring'] = self.querystring
info['result_count'] = self.result_count
+ info['thread_count'] = self.thread_count
info['result_count_positive'] = 's' if self.result_count > 1 else ''
return info
@@ -70,6 +73,7 @@ class SearchBuffer(Buffer):
try:
self.result_count = self.dbman.count_messages(self.querystring)
+ self.thread_count = self.dbman.count_threads(self.querystring)
self.pipe, self.proc = self.dbman.get_threads(self.querystring,
order,
exclude_tags)