Fix removing of automatic downloads w/ -1 timeout.
With ui -> remove-finished-downloads set to -1, when a download was started with auto_remove=True (like with :adblock-update), there was a QTimer set up with timeout -1, which causes this instead of doing something sane: WARNING: QTimer::singleShot: Timers cannot have negative timeouts
This commit is contained in:
parent
566f94111c
commit
2fc1612bd4
@ -793,10 +793,15 @@ class DownloadManager(QAbstractListModel):
|
|||||||
download = DownloadItem(reply, self._win_id, self)
|
download = DownloadItem(reply, self._win_id, self)
|
||||||
download.cancelled.connect(
|
download.cancelled.connect(
|
||||||
functools.partial(self.remove_item, download))
|
functools.partial(self.remove_item, download))
|
||||||
|
|
||||||
delay = config.get('ui', 'remove-finished-downloads')
|
delay = config.get('ui', 'remove-finished-downloads')
|
||||||
if delay > -1 or auto_remove:
|
if delay > -1:
|
||||||
download.finished.connect(
|
download.finished.connect(
|
||||||
functools.partial(self.remove_item_delayed, download, delay))
|
functools.partial(self.remove_item_delayed, download, delay))
|
||||||
|
elif auto_remove:
|
||||||
|
download.finished.connect(
|
||||||
|
functools.partial(self.remove_item, download))
|
||||||
|
|
||||||
download.data_changed.connect(
|
download.data_changed.connect(
|
||||||
functools.partial(self.on_data_changed, download))
|
functools.partial(self.on_data_changed, download))
|
||||||
download.error.connect(self.on_error)
|
download.error.connect(self.on_error)
|
||||||
|
Loading…
Reference in New Issue
Block a user