From e9da7b5391aa6eaed524d04ff9aa89ff41ac576a Mon Sep 17 00:00:00 2001 From: Joel Torstensson Date: Mon, 9 Feb 2015 17:03:02 +0100 Subject: [PATCH] :download-open now only opens finished downloads. --- qutebrowser/browser/downloads.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 01d6bf760..41fdef180 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -757,13 +757,14 @@ class DownloadManager(QAbstractListModel): @cmdutils.register(instance='download-manager', scope='window') def download_open(self, count: {'special': 'count'}=0): - """Open the last/[count]th download. + """Open the last/[count]th finished download. Args: count: The index of the download to cancel. """ + finished_items = [d for d in self.downloads if d.done] try: - download = self.downloads[count - 1] + download = finished_items[count - 1] except IndexError: raise cmdexc.CommandError("There's no download {}!".format(count)) download.open_file()