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: https://github.com/SerenityOS/serenity/commit/e4267020c42
3 changed files with 10 additions and 4 deletions
BIN
Base/res/icons/16x16/inspector-object-red.png
Normal file
BIN
Base/res/icons/16x16/inspector-object-red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 196 B |
|
@ -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) {
|
||||
|
|
|
@ -33,5 +33,7 @@ private:
|
|||
explicit ProfileModel(Profile&);
|
||||
|
||||
Profile& m_profile;
|
||||
GIcon m_frame_icon;
|
||||
|
||||
GIcon m_user_frame_icon;
|
||||
GIcon m_kernel_frame_icon;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue