mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 22:02:15 +01:00
reorganized filter actions
This commit is contained in:
parent
6db6969e1b
commit
3a2deeb7c4
1 changed files with 7 additions and 4 deletions
|
|
@ -183,14 +183,12 @@ class ActionModel(QtGui.QStandardItemModel):
|
|||
return icon
|
||||
|
||||
def filter_actions(self):
|
||||
self.items_by_id.clear()
|
||||
# Validate actions based on compatibility
|
||||
self.clear()
|
||||
|
||||
self.items_by_id.clear()
|
||||
actions = self.filter_compatible_actions(self._registered_actions)
|
||||
|
||||
self.beginResetModel()
|
||||
|
||||
single_actions = []
|
||||
varianted_actions = collections.defaultdict(list)
|
||||
grouped_actions = collections.defaultdict(list)
|
||||
|
|
@ -273,12 +271,17 @@ class ActionModel(QtGui.QStandardItemModel):
|
|||
|
||||
items_by_order[order].append(item)
|
||||
|
||||
self.beginResetModel()
|
||||
|
||||
items = []
|
||||
for order in sorted(items_by_order.keys()):
|
||||
for item in items_by_order[order]:
|
||||
item_id = str(uuid.uuid4())
|
||||
item.setData(item_id, ACTION_ID_ROLE)
|
||||
self.items_by_id[item_id] = item
|
||||
self.appendRow(item)
|
||||
items.append(item)
|
||||
|
||||
self.invisibleRootItem().appendRows(items)
|
||||
|
||||
self.endResetModel()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue