From 1fa50021c1bdb3b0380fe5319124a2f176c57cab Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sun, 8 May 2016 23:28:01 +0200 Subject: [PATCH] downloads: use right index for beginInsertRows len(self.downloads) is already the index of the item in the download list, this should be used for beginInsertRows(). The +1 is only for the human readable part. --- qutebrowser/browser/downloads.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 96c960f52..66d72cf14 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -897,8 +897,8 @@ class DownloadManager(QAbstractListModel): download.redirected.connect( functools.partial(self.on_redirect, download)) download.basename = suggested_filename - idx = len(self.downloads) + 1 - download.index = idx + idx = len(self.downloads) + download.index = idx + 1 # "Human readable" index self.beginInsertRows(QModelIndex(), idx, idx) self.downloads.append(download) self.endInsertRows()