Rename DownloadItem.do_retry
This commit is contained in:
parent
34b4dcf0d5
commit
352f83b95e
@ -291,8 +291,9 @@ class DownloadItem(QObject):
|
|||||||
cancelled: The download was cancelled.
|
cancelled: The download was cancelled.
|
||||||
error: An error with the download occurred.
|
error: An error with the download occurred.
|
||||||
arg: The error message as string.
|
arg: The error message as string.
|
||||||
do_retry: Emitted when a download is retried.
|
adopt_download: Emitted when a download is retried and should be adopted
|
||||||
arg 0: The new DownloadItem
|
by the QNAM if needed..
|
||||||
|
arg 0: The new DownloadItem
|
||||||
remove_requested: Emitted when the removal of this download was
|
remove_requested: Emitted when the removal of this download was
|
||||||
requested.
|
requested.
|
||||||
"""
|
"""
|
||||||
@ -302,7 +303,7 @@ class DownloadItem(QObject):
|
|||||||
finished = pyqtSignal()
|
finished = pyqtSignal()
|
||||||
error = pyqtSignal(str)
|
error = pyqtSignal(str)
|
||||||
cancelled = pyqtSignal()
|
cancelled = pyqtSignal()
|
||||||
do_retry = pyqtSignal(object) # DownloadItem
|
adopt_download = pyqtSignal(object) # DownloadItem
|
||||||
remove_requested = pyqtSignal()
|
remove_requested = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self, reply, win_id, parent=None):
|
def __init__(self, reply, win_id, parent=None):
|
||||||
@ -524,7 +525,7 @@ class DownloadItem(QObject):
|
|||||||
new_reply = self._retry_info.manager.get(self._retry_info.request)
|
new_reply = self._retry_info.manager.get(self._retry_info.request)
|
||||||
new_download = download_manager.fetch(
|
new_download = download_manager.fetch(
|
||||||
new_reply, suggested_filename=self.basename)
|
new_reply, suggested_filename=self.basename)
|
||||||
self.do_retry.emit(new_download)
|
self.adopt_download.emit(new_download)
|
||||||
self.cancel()
|
self.cancel()
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
|
@ -414,7 +414,7 @@ class NetworkManager(QNetworkAccessManager):
|
|||||||
log.downloads.debug("Adopted download, {} adopted.".format(
|
log.downloads.debug("Adopted download, {} adopted.".format(
|
||||||
self.adopted_downloads))
|
self.adopted_downloads))
|
||||||
download.destroyed.connect(self.on_adopted_download_destroyed)
|
download.destroyed.connect(self.on_adopted_download_destroyed)
|
||||||
download.do_retry.connect(self.adopt_download)
|
download.adopt_download.connect(self.adopt_download)
|
||||||
|
|
||||||
def set_referer(self, req, current_url):
|
def set_referer(self, req, current_url):
|
||||||
"""Set the referer header."""
|
"""Set the referer header."""
|
||||||
|
Loading…
Reference in New Issue
Block a user