From 324a5a2635580c2f347774e3976716bf90eacd1a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 7 Aug 2016 06:46:14 +0530 Subject: [PATCH] Do not show an error if the user tries to quit calibre while editing a cell in the book list. Instead, just silently abort the edit. See #1610539 (Data error when closing calibre) --- src/calibre/gui2/library/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index b563a0c6b8..c47377cfff 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -1048,6 +1048,9 @@ class BooksModel(QAbstractTableModel): # {{{ return True def setData(self, index, value, role): + from calibre.gui2.ui import get_gui + if get_gui().shutting_down: + return False if role == Qt.EditRole: from calibre.gui2.ui import get_gui try: @@ -1633,6 +1636,9 @@ class DeviceBooksModel(BooksModel): # {{{ return (section+1) def setData(self, index, value, role): + from calibre.gui2.ui import get_gui + if get_gui().shutting_down: + return False done = False if role == Qt.EditRole: row, col = index.row(), index.column()