mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
SystemMonitor: Make the process list searchable
This commit is contained in:
committed by
Ali Mohammad Pur
parent
52ed43d139
commit
000c74e6a8
Notes:
sideshowbarker
2024-07-18 04:27:07 +09:00
Author: https://github.com/d1823 Commit: https://github.com/SerenityOS/serenity/commit/000c74e6a81 Pull-request: https://github.com/SerenityOS/serenity/pull/9790 Reviewed-by: https://github.com/alimpfard ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
@@ -313,6 +313,24 @@ GUI::Variant ProcessModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
|
||||
return {};
|
||||
}
|
||||
|
||||
Vector<GUI::ModelIndex, 1> ProcessModel::matches(const StringView& searching, unsigned flags, const GUI::ModelIndex&)
|
||||
{
|
||||
Vector<GUI::ModelIndex, 1> found_indices;
|
||||
|
||||
for (auto& thread : m_threads) {
|
||||
if (string_matches(thread.value->current_state.name, searching, flags)) {
|
||||
auto maybe_tid_index = m_tids.find_first_index(thread.key);
|
||||
if (!maybe_tid_index.has_value())
|
||||
continue;
|
||||
found_indices.append(create_index(maybe_tid_index.value(), Column::Name));
|
||||
if (flags & FirstMatchOnly)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return found_indices;
|
||||
}
|
||||
|
||||
void ProcessModel::update()
|
||||
{
|
||||
auto previous_tid_count = m_tids.size();
|
||||
|
||||
Reference in New Issue
Block a user