Skip to content

Commit

Permalink
FunctionsView: Move 'function_count' into QFunctionTable
Browse files Browse the repository at this point in the history
  • Loading branch information
mborgerson committed Sep 24, 2023
1 parent 4db11b2 commit bfc4127
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions angrmanagement/ui/views/functions_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ def __init__(self, workspace, instance, default_docking_position, *args, **kwarg
def refresh(self):
self._function_table.refresh()

def set_function_count(self, count):
self.function_count = count

def reload(self):
if not self.instance.cfg.am_none:
self._function_table.function_manager = self.instance.kb.functions
Expand Down
7 changes: 4 additions & 3 deletions angrmanagement/ui/widgets/qfunction_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ def __init__(self, parent, instance, selection_callback=None):
self._status_label: QLabel

self._last_known_func_addrs: Set[int] = set()
self._function_count = None

self._init_widgets(selection_callback)

Expand All @@ -452,7 +453,7 @@ def function_manager(self) -> Optional["FunctionManager"]:
@function_manager.setter
def function_manager(self, v):
if v is not None:
self._view.set_function_count(len(v))
self._function_count = len(v)
if self._table_view is not None:
self._table_view.function_manager = v
else:
Expand All @@ -469,14 +470,14 @@ def refresh(self):
if self.function_manager is None:
return

if self._view.function_count != len(self.function_manager):
if self._function_count != len(self.function_manager):
# the number of functions has increased - we need to update the table
added_funcs, removed_funcs = self._updated_functions(self.function_manager)
else:
added_funcs, removed_funcs = None, None

self._table_view.refresh(added_funcs=added_funcs, removed_funcs=removed_funcs)
self._view.set_function_count(len(self._last_known_func_addrs))
self._function_count = len(self._last_known_func_addrs)
self.update_displayed_function_count()

def show_filter_box(self, prefix=""):
Expand Down

0 comments on commit bfc4127

Please sign in to comment.