Check for interval being positive.
Check for interval being positive instead of checking for it to be non-zero. So if somehow some unexpected thing happend and made message-timeout negative, the bug doesn't cascade.
This commit is contained in:
parent
1cb23f1193
commit
7da6908850
@ -98,7 +98,7 @@ class MessageView(QWidget):
|
|||||||
def _set_clear_timer_interval(self):
|
def _set_clear_timer_interval(self):
|
||||||
"""Configure self._clear_timer according to the config."""
|
"""Configure self._clear_timer according to the config."""
|
||||||
interval = config.get('ui', 'message-timeout')
|
interval = config.get('ui', 'message-timeout')
|
||||||
if interval != 0:
|
if interval > 0:
|
||||||
interval *= min(5, len(self._messages))
|
interval *= min(5, len(self._messages))
|
||||||
self._clear_timer.setInterval(interval)
|
self._clear_timer.setInterval(interval)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user