1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:17:34 +00:00

Profiler: Let the user select more than one process

This commit is contained in:
Gunnar Beutner 2021-05-08 01:33:43 +02:00 committed by Andreas Kling
parent 325d9445fd
commit 210d2d270d
3 changed files with 47 additions and 21 deletions

View file

@ -110,11 +110,11 @@ int main(int argc, char** argv)
auto& timeline_header = timeline_header_container->add<TimelineHeader>(*profile, process);
timeline_header.set_shrink_to_fit(true);
timeline_header.on_selection_change = [&](bool selected) {
if (selected) {
auto end_valid = process.end_valid == 0 ? profile->last_timestamp() : process.end_valid;
profile->set_process_filter(process.pid, process.start_valid, end_valid);
} else
profile->clear_process_filter();
auto end_valid = process.end_valid == 0 ? profile->last_timestamp() : process.end_valid;
if (selected)
profile->add_process_filter(process.pid, process.start_valid, end_valid);
else
profile->remove_process_filter(process.pid, process.start_valid, end_valid);
timeline_header_container->for_each_child_widget([](auto& other_timeline_header) {
static_cast<TimelineHeader&>(other_timeline_header).update_selection();