mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 15:32:51 +00:00
ProfileViewer: Show kernel frames with a red icon :^)
This commit is contained in:
parent
f692577559
commit
e4267020c4
Notes:
sideshowbarker
2024-07-19 10:51:42 +09:00
Author: https://github.com/awesomekling
Commit: e4267020c4
3 changed files with 10 additions and 4 deletions
|
@ -7,7 +7,8 @@
|
|||
ProfileModel::ProfileModel(Profile& profile)
|
||||
: m_profile(profile)
|
||||
{
|
||||
m_frame_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object.png"));
|
||||
m_user_frame_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object.png"));
|
||||
m_kernel_frame_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object-red.png"));
|
||||
}
|
||||
|
||||
ProfileModel::~ProfileModel()
|
||||
|
@ -90,8 +91,11 @@ GVariant ProfileModel::data(const GModelIndex& index, Role role) const
|
|||
{
|
||||
auto* node = static_cast<ProfileNode*>(index.internal_data());
|
||||
if (role == Role::Icon) {
|
||||
if (index.column() == Column::StackFrame)
|
||||
return m_frame_icon;
|
||||
if (index.column() == Column::StackFrame) {
|
||||
if (node->address() < (8 * MB))
|
||||
return m_kernel_frame_icon;
|
||||
return m_user_frame_icon;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
if (role == Role::Display) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue