Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use registry level cache, not local cache for algorithm name/icon han…
…dling
  • Loading branch information
nyalldawson committed Apr 20, 2023
1 parent 70f2adb commit 72dd888
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions python/plugins/processing/gui/HistoryDialog.py
Expand Up @@ -150,8 +150,6 @@ def fillTree(self):
if not entries:
return

names = {}
icons = {}
group_items = []
current_group_item = -1
current_date = ''
Expand All @@ -167,16 +165,11 @@ def fillTree(self):
name = ''
algorithm_id = entry.entry.get('algorithm_id')
if algorithm_id:
if algorithm_id not in names:
algorithm = QgsApplication.processingRegistry().algorithmById(algorithm_id)
if algorithm:
names[algorithm_id] = algorithm.displayName()
icons[algorithm_id] = QgsApplication.processingRegistry().algorithmById(algorithm_id).icon()
else:
names[algorithm_id] = ''
icons[algorithm_id] = self.keyIcon
name = names[algorithm_id]
icon = icons[algorithm_id]
algorithm_info = QgsApplication.processingRegistry().algorithmInformation(algorithm_id)
name = algorithm_info.displayName
if not algorithm_info.icon.isNull():
icon = algorithm_info.icon

item = TreeLogEntryItem(entry, name)
item.setIcon(0, icon)
group_items[current_group_item].insertChild(0, item)
Expand Down

0 comments on commit 72dd888

Please sign in to comment.