Stop download read timer when reply has finished.

See #307.
This commit is contained in:
Florian Bruhin 2014-12-18 23:08:19 +01:00
parent 29ce0a5157
commit 5c15f56213

View File

@ -414,7 +414,6 @@ class DownloadItem(QObject):
def finish_download(self): def finish_download(self):
"""Write buffered data to disk and finish the QNetworkReply.""" """Write buffered data to disk and finish the QNetworkReply."""
log.downloads.debug("Finishing download...") log.downloads.debug("Finishing download...")
self._read_timer.stop()
if self.reply.isOpen(): if self.reply.isOpen():
self.fileobj.write(self.reply.readAll()) self.fileobj.write(self.reply.readAll())
if self.autoclose: if self.autoclose:
@ -438,6 +437,7 @@ class DownloadItem(QObject):
""" """
if self.reply is None: if self.reply is None:
return return
self._read_timer.stop()
self.stats.finish() self.stats.finish()
is_redirected = self._handle_redirect() is_redirected = self._handle_redirect()
if is_redirected: if is_redirected: