summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2021-11-01 23:39:10 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-02 11:07:26 +0100
commit59619572d6877f703157648ae37a41fa23d4b77d (patch)
tree19b22f29c19881acba14f29e569b2051d5293dfd
parent17d95bc1db049d56d55c961566ca7ca76395346c (diff)
downloadserenity-59619572d6877f703157648ae37a41fa23d4b77d.zip
LibThreading: Remove redundant method
-rw-r--r--Userland/Applications/Assistant/Providers.cpp4
-rw-r--r--Userland/Applications/DisplaySettings/MonitorWidget.cpp2
-rw-r--r--Userland/Applications/SystemMonitor/ThreadStackWidget.cpp2
-rw-r--r--Userland/Libraries/LibGUI/FileSystemModel.cpp2
-rw-r--r--Userland/Libraries/LibThreading/BackgroundAction.h7
-rw-r--r--Userland/Services/WindowServer/Compositor.cpp2
6 files changed, 6 insertions, 13 deletions
diff --git a/Userland/Applications/Assistant/Providers.cpp b/Userland/Applications/Assistant/Providers.cpp
index c7f695bdc2..b7bc973574 100644
--- a/Userland/Applications/Assistant/Providers.cpp
+++ b/Userland/Applications/Assistant/Providers.cpp
@@ -132,7 +132,7 @@ void FileProvider::query(const String& query, Function<void(NonnullRefPtrVector<
if (m_fuzzy_match_work)
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) {
NonnullRefPtrVector<Result> results;
@@ -163,7 +163,7 @@ void FileProvider::build_filesystem_cache()
m_building_cache = true;
m_work_queue.enqueue("/");
- Threading::BackgroundAction<int>::create(
+ Threading::BackgroundAction<int>::construct(
[this](auto&) {
String slash = "/";
auto timer = Core::ElapsedTimer::start_new();
diff --git a/Userland/Applications/DisplaySettings/MonitorWidget.cpp b/Userland/Applications/DisplaySettings/MonitorWidget.cpp
index 5a853ccf79..858a82df75 100644
--- a/Userland/Applications/DisplaySettings/MonitorWidget.cpp
+++ b/Userland/Applications/DisplaySettings/MonitorWidget.cpp
@@ -30,7 +30,7 @@ bool MonitorWidget::set_wallpaper(String path)
if (!is_different_to_current_wallpaper_path(path))
return false;
- Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::create(
+ Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::construct(
[path](auto&) {
RefPtr<Gfx::Bitmap> bmp;
if (!path.is_empty())
diff --git a/Userland/Applications/SystemMonitor/ThreadStackWidget.cpp b/Userland/Applications/SystemMonitor/ThreadStackWidget.cpp
index edb56e31af..906e2bc08b 100644
--- a/Userland/Applications/SystemMonitor/ThreadStackWidget.cpp
+++ b/Userland/Applications/SystemMonitor/ThreadStackWidget.cpp
@@ -113,7 +113,7 @@ private:
void ThreadStackWidget::refresh()
{
- Threading::BackgroundAction<Vector<Symbolication::Symbol>>::create(
+ Threading::BackgroundAction<Vector<Symbolication::Symbol>>::construct(
[pid = m_pid, tid = m_tid](auto&) {
return Symbolication::symbolicate_thread(pid, tid, Symbolication::IncludeSourcePosition::No);
},
diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp
index bede6e23ec..744adef088 100644
--- a/Userland/Libraries/LibGUI/FileSystemModel.cpp
+++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp
@@ -652,7 +652,7 @@ bool FileSystemModel::fetch_thumbnail_for(Node const& node)
auto weak_this = make_weak_ptr();
- Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::create(
+ Threading::BackgroundAction<RefPtr<Gfx::Bitmap>>::construct(
[path](auto&) {
return render_thumbnail(path);
},
diff --git a/Userland/Libraries/LibThreading/BackgroundAction.h b/Userland/Libraries/LibThreading/BackgroundAction.h
index fa18627048..64d9338cc9 100644
--- a/Userland/Libraries/LibThreading/BackgroundAction.h
+++ b/Userland/Libraries/LibThreading/BackgroundAction.h
@@ -38,13 +38,6 @@ class BackgroundAction final : public Core::Object
C_OBJECT(BackgroundAction);
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()
{
m_cancelled = true;
diff --git a/Userland/Services/WindowServer/Compositor.cpp b/Userland/Services/WindowServer/Compositor.cpp
index fb753efe73..f66bda27f5 100644
--- a/Userland/Services/WindowServer/Compositor.cpp
+++ b/Userland/Services/WindowServer/Compositor.cpp
@@ -807,7 +807,7 @@ bool Compositor::set_wallpaper_mode(const String& mode)
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&) {
return Gfx::Bitmap::try_load_from_file(path);
},