Revert "Remove remove_data arg for DownloadItem.cancel"

This reverts commit ece85dc903.

It's actually needed in _ask_confirm_question...
This commit is contained in:
Florian Bruhin 2016-09-09 19:28:17 +02:00
parent 230cd40b12
commit b39d33d5e3

View File

@ -481,8 +481,12 @@ class DownloadItem(QObject):
self.stats.percentage(), system)
@pyqtSlot()
def cancel(self):
"""Cancel the download."""
def cancel(self, remove_data=True):
"""Cancel the download.
Args:
remove_data: Whether to remove the downloaded data.
"""
log.downloads.debug("cancelled")
self._read_timer.stop()
self.cancelled.emit()
@ -493,7 +497,8 @@ class DownloadItem(QObject):
self.reply = None
if self.fileobj is not None:
self.fileobj.close()
self.delete()
if remove_data:
self.delete()
self.done = True
self.finished.emit()
self.data_changed.emit()