diff options
author | Lucas Hoffmann <lucc@users.noreply.github.com> | 2017-08-03 20:47:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-03 20:47:14 +0200 |
commit | 827c9c0b78840048904883611a0c99bfa77b1725 (patch) | |
tree | b1897c566531c9f016723354a70f1e91c1b69186 | |
parent | fd4d4c8fb28fa74b57d1b9de721a4f3e0fd1fafd (diff) | |
parent | 6de3558becb6e64a73504cafd3353c02622b9498 (diff) |
Merge pull request #1099 from lucc/fix/1098
Fix message count in statusbar after tagging
-rw-r--r-- | alot/commands/search.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/alot/commands/search.py b/alot/commands/search.py index 49d95ebe..57975841 100644 --- a/alot/commands/search.py +++ b/alot/commands/search.py @@ -197,14 +197,6 @@ class TagCommand(Command): logging.debug('all? %s', self.allm) logging.debug('q: %s', testquery) - 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) - def refresh(): # remove thread from resultset if it doesn't match the search query # any more and refresh selected threadline otherwise @@ -212,13 +204,17 @@ class TagCommand(Command): # update total result count if not self.allm: if hitcount_after == 0: - 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) else: threadline_widget.rebuild() + searchbuffer.result_count = searchbuffer.dbman.count_messages( + searchbuffer.querystring) else: searchbuffer.rebuild() - searchbuffer.result_count += (hitcount_after - hitcount_before) ui.update() tags = [x for x in self.tagsstring.split(',') if x] |