mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 15:02:56 +00:00
LibThreading: Remove redundant method
This commit is contained in:
parent
17d95bc1db
commit
59619572d6
Notes:
sideshowbarker
2024-07-18 01:37:37 +09:00
Author: https://github.com/BenWiederhake
Commit: 59619572d6
Pull-request: https://github.com/SerenityOS/serenity/pull/10754
6 changed files with 6 additions and 13 deletions
|
@ -132,7 +132,7 @@ void FileProvider::query(const String& query, Function<void(NonnullRefPtrVector<
|
||||||
if (m_fuzzy_match_work)
|
if (m_fuzzy_match_work)
|
||||||
m_fuzzy_match_work->cancel();
|
m_fuzzy_match_work->cancel();
|
||||||
|
|
||||||
m_fuzzy_match_work = Threading::BackgroundAction<NonnullRefPtrVector<Result>>::create(
|
m_fuzzy_match_work = Threading::BackgroundAction<NonnullRefPtrVector<Result>>::construct(
|
||||||
[this, query](auto& task) {
|
[this, query](auto& task) {
|
||||||
NonnullRefPtrVector<Result> results;
|
NonnullRefPtrVector<Result> results;
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ void FileProvider::build_filesystem_cache()
|
||||||
m_building_cache = true;
|
m_building_cache = true;
|
||||||
m_work_queue.enqueue("/");
|
m_work_queue.enqueue("/");
|
||||||
|
|
||||||
Threading::BackgroundAction<int>::create(
|
Threading::BackgroundAction<int>::construct(
|
||||||
[this](auto&) {
|
[this](auto&) {
|
||||||
String slash = "/";
|
String slash = "/";
|
||||||
auto timer = Core::ElapsedTimer::start_new();
|
auto timer = Core::ElapsedTimer::start_new();
|
||||||
|
|
|
@ -30,7 +30,7 @@ bool MonitorWidget::set_wallpaper(String path)
|
||||||
if (!is_different_to_current_wallpaper_path(path))
|
if (!is_different_to_current_wallpaper_path(path))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::create(
|
Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::construct(
|
||||||
[path](auto&) {
|
[path](auto&) {
|
||||||
RefPtr<Gfx::Bitmap> bmp;
|
RefPtr<Gfx::Bitmap> bmp;
|
||||||
if (!path.is_empty())
|
if (!path.is_empty())
|
||||||
|
|
|
@ -113,7 +113,7 @@ private:
|
||||||
|
|
||||||
void ThreadStackWidget::refresh()
|
void ThreadStackWidget::refresh()
|
||||||
{
|
{
|
||||||
Threading::BackgroundAction<Vector<Symbolication::Symbol>>::create(
|
Threading::BackgroundAction<Vector<Symbolication::Symbol>>::construct(
|
||||||
[pid = m_pid, tid = m_tid](auto&) {
|
[pid = m_pid, tid = m_tid](auto&) {
|
||||||
return Symbolication::symbolicate_thread(pid, tid, Symbolication::IncludeSourcePosition::No);
|
return Symbolication::symbolicate_thread(pid, tid, Symbolication::IncludeSourcePosition::No);
|
||||||
},
|
},
|
||||||
|
|
|
@ -652,7 +652,7 @@ bool FileSystemModel::fetch_thumbnail_for(Node const& node)
|
||||||
|
|
||||||
auto weak_this = make_weak_ptr();
|
auto weak_this = make_weak_ptr();
|
||||||
|
|
||||||
Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::create(
|
Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::construct(
|
||||||
[path](auto&) {
|
[path](auto&) {
|
||||||
return render_thumbnail(path);
|
return render_thumbnail(path);
|
||||||
},
|
},
|
||||||
|
|
|
@ -38,13 +38,6 @@ class BackgroundAction final : public Core::Object
|
||||||
C_OBJECT(BackgroundAction);
|
C_OBJECT(BackgroundAction);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static NonnullRefPtr<BackgroundAction<Result>> create(
|
|
||||||
Function<Result(BackgroundAction&)> action,
|
|
||||||
Function<void(Result)> on_complete = nullptr)
|
|
||||||
{
|
|
||||||
return adopt_ref(*new BackgroundAction(move(action), move(on_complete)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void cancel()
|
void cancel()
|
||||||
{
|
{
|
||||||
m_cancelled = true;
|
m_cancelled = true;
|
||||||
|
|
|
@ -807,7 +807,7 @@ bool Compositor::set_wallpaper_mode(const String& mode)
|
||||||
|
|
||||||
bool Compositor::set_wallpaper(const String& path, Function<void(bool)>&& callback)
|
bool Compositor::set_wallpaper(const String& path, Function<void(bool)>&& callback)
|
||||||
{
|
{
|
||||||
Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::create(
|
Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::construct(
|
||||||
[path](auto&) {
|
[path](auto&) {
|
||||||
return Gfx::Bitmap::try_load_from_file(path);
|
return Gfx::Bitmap::try_load_from_file(path);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue