1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

SpaceAnalyzer: Make TreeMapWidget responsible for filesystem analysis

Also, the Tree object was only ever used by the TreeMapWidget, so its
creation can happen inside `analyze()`, fixing the memory leak issue.
Plus, it doesn't have to be RefCounted.
This commit is contained in:
Sam Atkins 2023-02-03 14:00:00 +00:00 committed by Andreas Kling
parent 98e9ee07e3
commit 1ec59cc52a
4 changed files with 82 additions and 93 deletions

View file

@ -24,7 +24,7 @@ public:
TreeNode const* path_node(size_t n) const;
size_t viewpoint() const;
void set_viewpoint(size_t);
void set_tree(RefPtr<Tree> tree);
ErrorOr<void> analyze(GUI::Statusbar&);
private:
TreeMapWidget() = default;
@ -53,7 +53,7 @@ private:
Vector<DeprecatedString> path_to_position(Gfx::IntPoint);
void recalculate_path_for_new_tree();
RefPtr<Tree> m_tree;
OwnPtr<Tree> m_tree;
Vector<DeprecatedString> m_path;
size_t m_viewpoint { 0 };
void const* m_selected_node_cache;