mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07:45 +00:00
Assistant: Make Result bitmaps virtual/lazy
Result classes now return their bitmap via a virtual Gfx::Bitmap* getter. This effectively makes bitmap fetching lazier, since only results that end up on screen actually get asked for their bitmap. This drastically reduces the amount of work done by the FileProvider background worker.
This commit is contained in:
parent
1c29e2f3f7
commit
513e67e2eb
2 changed files with 37 additions and 11 deletions
|
@ -112,6 +112,11 @@ void CalculatorProvider::query(String const& query, Function<void(NonnullRefPtrV
|
|||
on_complete(results);
|
||||
}
|
||||
|
||||
Gfx::Bitmap const* FileResult::bitmap() const
|
||||
{
|
||||
return GUI::Icon::default_icon("filetype-folder").bitmap_for_size(16);
|
||||
}
|
||||
|
||||
void FileProvider::query(const String& query, Function<void(NonnullRefPtrVector<Result>)> on_complete)
|
||||
{
|
||||
build_filesystem_cache();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue