mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix allowing expand children when no child is expandable
This commit is contained in:
parent
e0bc2d8ebe
commit
2aeb23f868
@ -901,12 +901,13 @@ class TagsView(QTreeView): # {{{
|
|||||||
|
|
||||||
def has_unexpanded_children(self, index):
|
def has_unexpanded_children(self, index):
|
||||||
if not index.isValid():
|
if not index.isValid():
|
||||||
return
|
return False
|
||||||
if self.has_children(index) and not self.isExpanded(index):
|
for r in range(self._model.rowCount(index)):
|
||||||
return True
|
dex = index.child(r, 0)
|
||||||
for r in range(self.model().rowCount(index)):
|
if self._model.rowCount(dex) > 0:
|
||||||
if self.has_unexpanded_children(index.child(r, 0)):
|
if not self.isExpanded(dex):
|
||||||
return True
|
return True
|
||||||
|
return self.has_unexpanded_children(dex)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def collapse_menu_hovered(self, action):
|
def collapse_menu_hovered(self, action):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user