mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-21 07:29:53 +00:00
LibCore: Remove unused "visible for timer purposes" concept
This was a long-unused leftover from SerenityOS.
This commit is contained in:
parent
0037df88d5
commit
c47e253c60
Notes:
github-actions[bot]
2025-08-11 14:57:04 +00:00
Author: https://github.com/awesomekling
Commit: c47e253c60
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5817
Reviewed-by: https://github.com/gmta ✅
17 changed files with 24 additions and 63 deletions
|
@ -244,28 +244,24 @@ void EventLoopImplementationQt::set_main_loop()
|
|||
event_loop_manager.set_main_loop_signal_notifiers({});
|
||||
}
|
||||
|
||||
static void qt_timer_fired(Core::TimerShouldFireWhenNotVisible should_fire_when_not_visible, Core::EventReceiver& object)
|
||||
static void qt_timer_fired(Core::EventReceiver& object)
|
||||
{
|
||||
if (should_fire_when_not_visible == Core::TimerShouldFireWhenNotVisible::No) {
|
||||
if (!object.is_visible_for_timer_purposes())
|
||||
return;
|
||||
}
|
||||
Core::TimerEvent event;
|
||||
object.dispatch_event(event);
|
||||
}
|
||||
|
||||
intptr_t EventLoopManagerQt::register_timer(Core::EventReceiver& object, int milliseconds, bool should_reload, Core::TimerShouldFireWhenNotVisible should_fire_when_not_visible)
|
||||
intptr_t EventLoopManagerQt::register_timer(Core::EventReceiver& object, int milliseconds, bool should_reload)
|
||||
{
|
||||
auto timer = new QTimer;
|
||||
timer->setTimerType(Qt::PreciseTimer);
|
||||
timer->setInterval(milliseconds);
|
||||
timer->setSingleShot(!should_reload);
|
||||
auto weak_object = object.make_weak_ptr();
|
||||
QObject::connect(timer, &QTimer::timeout, [should_fire_when_not_visible, weak_object = move(weak_object)] {
|
||||
QObject::connect(timer, &QTimer::timeout, [weak_object = move(weak_object)] {
|
||||
auto object = weak_object.strong_ref();
|
||||
if (!object)
|
||||
return;
|
||||
qt_timer_fired(should_fire_when_not_visible, *object);
|
||||
qt_timer_fired(*object);
|
||||
});
|
||||
timer->start();
|
||||
return bit_cast<intptr_t>(timer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue