From 94434ea739619fc950934b9eb1608cfee5c0a7c6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 23 Feb 2015 10:01:37 +0100 Subject: [PATCH] Decorate DownloadItem slots with @pyqtSlot. Before, using the right-click menu to cancel the download didn't actually cancel it, as the QAction.toggled signal was emitted with checked=False which got interpreted as remove_data=False. --- qutebrowser/browser/downloads.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 71687e702..38b1bf1ce 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -341,6 +341,7 @@ class DownloadItem(QObject): return utils.interpolate_color( start, stop, self.stats.percentage(), system) + @pyqtSlot() def cancel(self, remove_data=True): """Cancel the download. @@ -363,6 +364,7 @@ class DownloadItem(QObject): self.finished.emit() self.data_changed.emit() + @pyqtSlot() def delete(self): """Delete the downloaded file""" try: @@ -371,12 +373,14 @@ class DownloadItem(QObject): except OSError: log.downloads.exception("Failed to remove partial file") + @pyqtSlot() def retry(self): """Retry a failed download.""" self.cancel() new_reply = self.retry_info.manager.get(self.retry_info.request) self.do_retry.emit(new_reply) + @pyqtSlot() def open_file(self): """Open the downloaded file.""" assert self.successful