Improve the ternary if in expand state on manuscript dialog

This commit is contained in:
Veronica Berglyd Olsen
2023-09-01 18:46:01 +02:00
parent 206265b6d3
commit 856e504c26
+1 -3
View File
@@ -545,9 +545,7 @@ class _DetailsWidget(QWidget):
for i in range(self.listView.topLevelItemCount()):
item = self.listView.topLevelItem(i)
if isinstance(item, QTreeWidgetItem):
item.setExpanded(
(state[i] if i < count else True) if item.childCount() > 0 else False
)
item.setExpanded((state[i] if i < count else True) and item.childCount() > 0)
return
##