From 47c1908da2a774ac13f66d0069088fcc425aea1f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 13 Jun 2014 20:18:16 +0200 Subject: [PATCH] Keep a reference to download path Question objects. --- qutebrowser/browser/downloads.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 10e81c2f3..e26aace2d 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -276,6 +276,10 @@ class DownloadManager(QObject): """Manager for running downloads. + Attributes: + downloads: A list of active DownloadItems. + questions: A list of Question objects to not GC them. + Signals: download_about_to_be_added: A new download will be added. arg: The index of the new download. @@ -296,6 +300,7 @@ class DownloadManager(QObject): def __init__(self, parent=None): super().__init__(parent) self.downloads = [] + self.questions = [] def _get_filename(self, reply): """Get a suitable filename to download a file to. @@ -350,6 +355,7 @@ class DownloadManager(QObject): q.default = suggested_filepath q.answered.connect(download.set_filename) q.cancelled.connect(download.cancel) + self.questions.append(q) download.cancelled.connect(q.abort) message.instance().question.emit(q, False)