mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
avoid usage of 'clear' method
This commit is contained in:
parent
78460c2d38
commit
10125a4078
1 changed files with 7 additions and 6 deletions
|
|
@ -26,14 +26,15 @@ class InstancesModel(QtGui.QStandardItemModel):
|
|||
return self._items_by_id
|
||||
|
||||
def set_report(self, report_item):
|
||||
self.clear()
|
||||
root_item = self.invisibleRootItem()
|
||||
if root_item.rowCount():
|
||||
root_item.removeRows(0, root_item.rowCount())
|
||||
|
||||
self._items_by_id.clear()
|
||||
self._plugin_items_by_id.clear()
|
||||
if not report_item:
|
||||
return
|
||||
|
||||
root_item = self.invisibleRootItem()
|
||||
|
||||
families = set(report_item.instance_items_by_family.keys())
|
||||
families.remove(None)
|
||||
all_families = list(sorted(families))
|
||||
|
|
@ -125,14 +126,14 @@ class PluginsModel(QtGui.QStandardItemModel):
|
|||
return self._items_by_id
|
||||
|
||||
def set_report(self, report_item):
|
||||
self.clear()
|
||||
root_item = self.invisibleRootItem()
|
||||
if root_item.rowCount() > 0:
|
||||
root_item.removeRows(0, root_item.rowCount())
|
||||
self._items_by_id.clear()
|
||||
self._plugin_items_by_id.clear()
|
||||
if not report_item:
|
||||
return
|
||||
|
||||
root_item = self.invisibleRootItem()
|
||||
|
||||
labels_iter = iter(self.order_label_mapping)
|
||||
cur_order, cur_label = next(labels_iter)
|
||||
cur_plugin_items = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue