Skip to content

Commit

Permalink
Refactored callers of _on_data
Browse files Browse the repository at this point in the history
  • Loading branch information
lfdversluis committed Jul 5, 2016
1 parent a7b7407 commit 9611f6e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Tribler/Main/vwxGUI/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ def refreshDirty(self):
self.list.dirty = False
self.dirtyset.clear()

@inlineCallbacks
# TODO (Laurens): Refactor callers because deferred.
def refresh(self, search_results=None):
self._logger.debug("ChannelManager complete refresh")
if self.category != 'searchresults':
Expand Down Expand Up @@ -448,14 +450,15 @@ def db_callback():
else:
if search_results:
total_items = len(search_results)
self._on_data(search_results, self.category)
yield self._on_data(search_results, self.category)

@inlineCallbacks
# TODO (Laurens): Refactor callers because deferred.
def _on_data_delayed(self, delayedResult):
data, category = delayedResult.get()
self._on_data(data, category)
yield self._on_data(data, category)

@inlineCallbacks
# TODO (Laurens): Refactor callers because deferred.
def _on_data(self, data, category):
if category == self.category:
if category != 'searchresults': # if we filter empty channels from search we will never see them
Expand Down

0 comments on commit 9611f6e

Please sign in to comment.