mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3664 (Program Crashes When Attempting to Add Books to 0.6.15)
This commit is contained in:
parent
924e1cee7d
commit
a1725b4ee3
@ -147,6 +147,7 @@ class TagsModel(QAbstractItemModel):
|
||||
state_map = dict(izip(names, states))
|
||||
category_index = self.index(i, 0, QModelIndex())
|
||||
if len(category.children) > 0:
|
||||
r, self.rowCount(category_index)
|
||||
self.beginRemoveRows(category_index, 0,
|
||||
len(category.children)-1)
|
||||
category.children = []
|
||||
@ -167,6 +168,13 @@ class TagsModel(QAbstractItemModel):
|
||||
item = index.internalPointer()
|
||||
return item.data(role)
|
||||
|
||||
def headerData(self, *args):
|
||||
return NONE
|
||||
|
||||
def flags(self, *args):
|
||||
return Qt.ItemIsEnabled|Qt.ItemIsSelectable
|
||||
|
||||
|
||||
def index(self, row, column, parent):
|
||||
if not self.hasIndex(row, column, parent):
|
||||
return QModelIndex()
|
||||
|
Loading…
x
Reference in New Issue
Block a user