From 124a3d80118ee4ce9632adc1854e7bebe531b74b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 29 Dec 2016 09:22:48 +0530 Subject: [PATCH] Edit Book: Reports tool: Fix an error when right clicking on items in the Links view. See #1652960 (Download external resources) --- src/calibre/gui2/tweak_book/reports.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/reports.py b/src/calibre/gui2/tweak_book/reports.py index e79c679854..a434b3bc46 100644 --- a/src/calibre/gui2/tweak_book/reports.py +++ b/src/calibre/gui2/tweak_book/reports.py @@ -56,6 +56,7 @@ def save_state(name, val): tprefs['reports-ui-state'] = data = {} data[name] = val + SORT_ROLE = Qt.UserRole + 1 @@ -111,7 +112,7 @@ class FileCollection(QAbstractTableModel): def location(self, index): try: return self.files[index.row()].name - except IndexError: + except (IndexError, AttributeError): pass @@ -350,6 +351,7 @@ class Jump(object): loc = locations[self.pos_map[key]] jump_to_location(loc) + jump = Jump() # }}} # Images {{{ @@ -1441,6 +1443,7 @@ class Reports(Dialog): Dialog.reject(self) # }}} + if __name__ == '__main__': from calibre.gui2 import Application import sys