Clear signal cache on loadStarted

This commit is contained in:
Florian Bruhin 2014-02-05 17:27:57 +01:00
parent 8e35fb5656
commit 444b813cf5

View File

@ -65,6 +65,7 @@ class TabbedBrowser(TabWidget):
self.setCurrentWidget(tab)
tab.loadProgress.connect(self._filter_factory(self.cur_progress))
tab.loadFinished.connect(self._filter_factory(self.cur_load_finished))
tab.loadStarted.connect(self._clear_signal_cache)
tab.loadStarted.connect(self._filter_factory(self.cur_load_started))
tab.statusBarMessage.connect(
self._filter_factory(self.cur_statusbar_message))
@ -318,6 +319,9 @@ class TabbedBrowser(TabWidget):
"""Returns a partial functon calling _filter_signals with a signal."""
return functools.partial(self._filter_signals, signal)
def _clear_signal_cache(self, *args):
self.sender().signal_cache = OrderedDict()
def _filter_signals(self, signal, *args):
"""Filter signals and trigger TabbedBrowser signals if the signal
was sent from the _current_ tab and not from any other one.