Fix download redirections and :adblock-update.
We called init_reply again which started read_timer even if the file object was already set. Fixes #294.
This commit is contained in:
parent
316d5ff189
commit
cb67198f7d
@ -272,6 +272,7 @@ class DownloadItem(QObject):
|
|||||||
reply.finished.connect(self.on_reply_finished)
|
reply.finished.connect(self.on_reply_finished)
|
||||||
reply.error.connect(self.on_reply_error)
|
reply.error.connect(self.on_reply_error)
|
||||||
reply.readyRead.connect(self.on_ready_read)
|
reply.readyRead.connect(self.on_ready_read)
|
||||||
|
if not self.fileobj:
|
||||||
self._read_timer.start()
|
self._read_timer.start()
|
||||||
# We could have got signals before we connected slots to them.
|
# We could have got signals before we connected slots to them.
|
||||||
# Here no signals are connected to the DownloadItem yet, so we use a
|
# Here no signals are connected to the DownloadItem yet, so we use a
|
||||||
@ -367,7 +368,7 @@ class DownloadItem(QObject):
|
|||||||
if self.reply.isFinished():
|
if self.reply.isFinished():
|
||||||
# Downloading to the buffer in RAM has already finished so we
|
# Downloading to the buffer in RAM has already finished so we
|
||||||
# write out the data and clean up now.
|
# write out the data and clean up now.
|
||||||
self.finish_download()
|
self.on_reply_finished()
|
||||||
else:
|
else:
|
||||||
# Since the buffer already might be full, on_ready_read might
|
# Since the buffer already might be full, on_ready_read might
|
||||||
# not be called at all anymore, so we force it here to flush
|
# not be called at all anymore, so we force it here to flush
|
||||||
|
Loading…
Reference in New Issue
Block a user