diff --git a/Libraries/LibCore/CMakeLists.txt b/Libraries/LibCore/CMakeLists.txt index 1b30391d108..6a520b037b8 100644 --- a/Libraries/LibCore/CMakeLists.txt +++ b/Libraries/LibCore/CMakeLists.txt @@ -42,7 +42,6 @@ set(SOURCES ConfigFile.cpp DateTime.cpp ElapsedTimer.cpp - Event.cpp EventLoop.cpp EventLoopImplementation.cpp EventReceiver.cpp diff --git a/Libraries/LibCore/Event.cpp b/Libraries/LibCore/Event.cpp deleted file mode 100644 index f4779dc350b..00000000000 --- a/Libraries/LibCore/Event.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2018-2020, Andreas Kling - * Copyright (c) 2022, the SerenityOS developers. - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#include -#include -#include - -namespace Core { - -ChildEvent::ChildEvent(Type type, EventReceiver& child, EventReceiver* insertion_before_child) - : Core::Event(type) - , m_child(child.make_weak_ptr()) - , m_insertion_before_child(AK::make_weak_ptr_if_nonnull(insertion_before_child)) -{ -} - -EventReceiver* ChildEvent::child() -{ - if (auto ref = m_child.strong_ref()) - return ref.ptr(); - return nullptr; -} - -EventReceiver const* ChildEvent::child() const -{ - if (auto ref = m_child.strong_ref()) - return ref.ptr(); - return nullptr; -} - -EventReceiver* ChildEvent::insertion_before_child() -{ - if (auto ref = m_insertion_before_child.strong_ref()) - return ref.ptr(); - return nullptr; -} - -EventReceiver const* ChildEvent::insertion_before_child() const -{ - if (auto ref = m_insertion_before_child.strong_ref()) - return ref.ptr(); - return nullptr; -} - -} diff --git a/Libraries/LibCore/Event.h b/Libraries/LibCore/Event.h index 26ac1efaec6..3dca54bace6 100644 --- a/Libraries/LibCore/Event.h +++ b/Libraries/LibCore/Event.h @@ -24,8 +24,6 @@ public: Timer, NotifierActivation, DeferredInvoke, - ChildAdded, - ChildRemoved, Custom, }; @@ -102,22 +100,6 @@ private: NotificationType m_type; }; -class ChildEvent final : public Event { -public: - ChildEvent(Type, EventReceiver& child, EventReceiver* insertion_before_child = nullptr); - ~ChildEvent() = default; - - EventReceiver* child(); - EventReceiver const* child() const; - - EventReceiver* insertion_before_child(); - EventReceiver const* insertion_before_child() const; - -private: - WeakPtr m_child; - WeakPtr m_insertion_before_child; -}; - class CustomEvent : public Event { public: CustomEvent(int custom_type) diff --git a/Libraries/LibCore/EventReceiver.cpp b/Libraries/LibCore/EventReceiver.cpp index 59b82ce6f2e..36a8294b60a 100644 --- a/Libraries/LibCore/EventReceiver.cpp +++ b/Libraries/LibCore/EventReceiver.cpp @@ -28,9 +28,6 @@ void EventReceiver::event(Core::Event& event) if (!m_timer_id) break; // Too late, the timer was already stopped. return timer_event(static_cast(event)); - case Core::Event::ChildAdded: - case Core::Event::ChildRemoved: - return child_event(static_cast(event)); case Core::Event::Invalid: VERIFY_NOT_REACHED(); break; @@ -45,10 +42,6 @@ void EventReceiver::timer_event(Core::TimerEvent&) { } -void EventReceiver::child_event(Core::ChildEvent&) -{ -} - void EventReceiver::custom_event(CustomEvent&) { } diff --git a/Libraries/LibCore/EventReceiver.h b/Libraries/LibCore/EventReceiver.h index c90571017cf..cf2f1f4a95d 100644 --- a/Libraries/LibCore/EventReceiver.h +++ b/Libraries/LibCore/EventReceiver.h @@ -82,9 +82,6 @@ protected: virtual void timer_event(TimerEvent&); virtual void custom_event(CustomEvent&); - // NOTE: You may get child events for children that are not yet fully constructed! - virtual void child_event(ChildEvent&); - private: intptr_t m_timer_id { 0 }; }; diff --git a/Libraries/LibCore/Forward.h b/Libraries/LibCore/Forward.h index c78de9f96e1..26aaa4d01aa 100644 --- a/Libraries/LibCore/Forward.h +++ b/Libraries/LibCore/Forward.h @@ -13,7 +13,6 @@ namespace Core { class AnonymousBuffer; class ArgsParser; class BufferedSocketBase; -class ChildEvent; class ConfigFile; class CustomEvent; class DateTime;