Skip to content

Commit

Permalink
QFunctionTable: Fix functions not being filtered by name when alignme…
Browse files Browse the repository at this point in the history
…nt is toggled
  • Loading branch information
mborgerson committed Sep 24, 2023
1 parent bfc4127 commit 19f2409
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions angrmanagement/ui/widgets/qfunction_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ def __init__(self, parent, workspace, instance, selection_callback=None):
self.setHorizontalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel)

self.show_alignment_functions = False
self.filter_text = ""
self._functions = None
self._model = QFunctionTableModel(self.workspace, self.instance, [])

Expand Down Expand Up @@ -361,6 +362,7 @@ def subscribe_func_select(self, callback):
self._selected_func.am_subscribe(callback)

def filter(self, keyword):
self.filter_text = keyword
self._model.filter(keyword)

def jump_to_result(self, index=0):
Expand All @@ -373,6 +375,7 @@ def load_functions(self):
self._model.func_list = [v for v in self._functions.values() if not v.alignment]
else:
self._model.func_list = list(self._functions.values())
self._model.filter(self.filter_text)

def _on_function_selected(self, model_index):
row = model_index.row()
Expand Down

0 comments on commit 19f2409

Please sign in to comment.