Skip to content

Commit

Permalink
Integrate _ITEMS in _clear_widgets()
Browse files Browse the repository at this point in the history
One more place, where we are now able to remove direct references to `StatusBarItem`s.
  • Loading branch information
pylbrecht committed Sep 8, 2024
1 parent 82981f1 commit 0d89940
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions qutebrowser/mainwindow/statusbar/bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,10 @@ def _draw_widgets(self):
def _clear_widgets(self):
"""Clear widgets before redrawing them."""
# Start with widgets hidden and show them when needed
for widget in [self.url, self.percentage,
self.backforward, self.tabindex,
self.keystring, self.prog, self.clock,
*self._text_widgets]:
assert isinstance(widget, StatusBarItem)

# FIXME(pylbrecht): add proper interface to get all items
global _ITEMS
for widget in _ITEMS.values():
widget.disable()
self._hbox.removeWidget(widget.widget)
self._text_widgets.clear()
Expand Down

0 comments on commit 0d89940

Please sign in to comment.