diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-06-24 13:31:14 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-06-24 13:31:14 +0100 |
commit | 7161a28bb453cc6df0c4efb44143b917b25f5007 (patch) | |
tree | 682dfd8f9c0c97ae338fcb2c4c79bf869512a905 /alot/commands/search.py | |
parent | 66894a89719f60fb5d87a918439416ebabe2a8c6 (diff) | |
parent | 46e165f02011f73ee2ce3785e2abf305797a0839 (diff) |
Merge branch '0.3.1-fix-msg-count-463'
Diffstat (limited to 'alot/commands/search.py')
-rw-r--r-- | alot/commands/search.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/alot/commands/search.py b/alot/commands/search.py index 2b2a6c5e..22bca06b 100644 --- a/alot/commands/search.py +++ b/alot/commands/search.py @@ -160,21 +160,25 @@ class TagCommand(Command): thread = threadline_widget.get_thread() testquery = "(%s) AND thread:%s" % (searchbuffer.querystring, thread.get_thread_id()) + hitcount_before = ui.dbman.count_messages(testquery) def remove_thread(): logging.debug('remove thread from result list: %s' % thread) if threadline_widget in searchbuffer.threadlist: + # remove this thread from result list searchbuffer.threadlist.remove(threadline_widget) - searchbuffer.result_count -= thread.get_total_messages() def refresh(): # remove thread from resultset if it doesn't match the search query # any more and refresh selected threadline otherwise - if ui.dbman.count_messages(testquery) == 0: + hitcount_after = ui.dbman.count_messages(testquery) + if hitcount_after == 0: remove_thread() - ui.update() else: threadline_widget.rebuild() + # update total result count + searchbuffer.result_count += (hitcount_after - hitcount_before) + ui.update() tags = filter(lambda x: x, self.tagsstring.split(',')) try: |