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

ProfileViewer: Make sure ProfileNodes have the correct parent pointer

We were forgetting to call ProfileNode::add_child() which is how the
parent node pointer gets set. This fixes the weird looking GTreeView.
This commit is contained in:
Andreas Kling 2019-12-12 22:49:54 +01:00
parent d8b7cd940f
commit 9150be4716
3 changed files with 9 additions and 8 deletions

View file

@ -43,7 +43,7 @@ public:
}
}
auto new_child = ProfileNode::create(symbol, address, offset);
m_children.append(new_child);
add_child(new_child);
return new_child;
};
@ -77,12 +77,12 @@ public:
GModel& model();
const NonnullRefPtrVector<ProfileNode>& roots() const { return m_roots; }
const Vector<NonnullRefPtr<ProfileNode>>& roots() const { return m_roots; }
private:
explicit Profile(const JsonArray&, NonnullRefPtrVector<ProfileNode>&&);
explicit Profile(const JsonArray&, Vector<NonnullRefPtr<ProfileNode>>&&);
JsonArray m_json;
RefPtr<ProfileModel> m_model;
NonnullRefPtrVector<ProfileNode> m_roots;
Vector<NonnullRefPtr<ProfileNode>> m_roots;
};