Fix #1981453 [Copy from Author to Author Sort Crashes in Manage Authors.](https://bugs.launchpad.net/calibre/+bug/1981453)

This commit is contained in:
Kovid Goyal 2022-07-12 19:57:10 +05:30
parent a17f54814a
commit cf3f5f131d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -475,6 +475,7 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
def cell_changed(self, row, col): def cell_changed(self, row, col):
id_ = int(self.table.item(row, 0).data(Qt.ItemDataRole.UserRole)) id_ = int(self.table.item(row, 0).data(Qt.ItemDataRole.UserRole))
self.table.cellChanged.disconnect(self.cell_changed)
if col == 0: if col == 0:
item = self.table.item(row, 0) item = self.table.item(row, 0)
aut = str(item.text()).strip() aut = str(item.text()).strip()
@ -497,5 +498,6 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
item.set_sort_key() item.set_sort_key()
self.set_icon(item, id_) self.set_icon(item, id_)
self.authors[id_][self.get_column_name(col)] = str(item.text()) self.authors[id_][self.get_column_name(col)] = str(item.text())
self.table.cellChanged.connect(self.cell_changed)
self.table.setCurrentItem(item) self.table.setCurrentItem(item)
self.table.scrollToItem(item) self.table.scrollToItem(item)