Skip to content

Commit f4b51a6

Browse files
committed
LibCore: Remove CTimer::create() overloads in favor of construct()
1 parent 9e00651 commit f4b51a6

File tree

13 files changed

+14
-24
lines changed

13 files changed

+14
-24
lines changed

Applications/PaintBrush/SprayTool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
SprayTool::SprayTool()
1313
{
14-
m_timer = CTimer::create();
14+
m_timer = CTimer::construct();
1515
m_timer->on_timeout = [&]() {
1616
paint_it();
1717
};

Applications/SoundPlayer/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ int main(int argc, char** argv)
5252

5353
auto next_sample_buffer = loader.get_more_samples();
5454

55-
auto timer = CTimer::create(100, [&] {
55+
auto timer = CTimer::construct(100, [&] {
5656
if (!next_sample_buffer) {
5757
sample_widget->set_buffer(nullptr);
5858
return;

Applications/SystemMonitor/NetworkStatisticsWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget(GWidget* parent)
5555
net_tcp_fields.empend("bytes_out", "Bytes Out", TextAlignment::CenterRight);
5656
m_socket_table_view->set_model(GJsonArrayModel::create("/proc/net/tcp", move(net_tcp_fields)));
5757

58-
m_update_timer = CTimer::create(
58+
m_update_timer = CTimer::construct(
5959
1000, [this] {
6060
update_models();
6161
},

Applications/SystemMonitor/ProcessStacksWidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ProcessStacksWidget::ProcessStacksWidget(GWidget* parent)
1111
m_stacks_editor = GTextEditor::construct(GTextEditor::Type::MultiLine, this);
1212
m_stacks_editor->set_readonly(true);
1313

14-
m_timer = CTimer::create(1000, [this] { refresh(); }, this);
14+
m_timer = CTimer::construct(1000, [this] { refresh(); }, this);
1515
}
1616

1717
ProcessStacksWidget::~ProcessStacksWidget()

Applications/SystemMonitor/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int main(int argc, char** argv)
111111
auto* process_table_view = new ProcessTableView(*cpu_graph, process_table_container);
112112
auto* memory_stats_widget = new MemoryStatsWidget(*memory_graph, graphs_container);
113113

114-
auto refresh_timer = CTimer::create(1000, [&] {
114+
auto refresh_timer = CTimer::construct(1000, [&] {
115115
process_table_view->refresh();
116116
memory_stats_widget->refresh();
117117
});

Applications/Terminal/TerminalWidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ TerminalWidget::TerminalWidget(int ptm_fd, RefPtr<CConfigFile> config)
2525
, m_notifier(CNotifier::construct(ptm_fd, CNotifier::Read))
2626
, m_config(move(config))
2727
{
28-
m_cursor_blink_timer = CTimer::create();
29-
m_visual_beep_timer = CTimer::create();
28+
m_cursor_blink_timer = CTimer::construct();
29+
m_visual_beep_timer = CTimer::construct();
3030

3131
set_frame_shape(FrameShape::Container);
3232
set_frame_shadow(FrameShadow::Sunken);

Demos/WidgetGallery/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int main(int argc, char** argv)
4444
button2->set_enabled(false);
4545

4646
auto progress1 = GProgressBar::construct(main_widget);
47-
auto timer = CTimer::create(100, [&] {
47+
auto timer = CTimer::construct(100, [&] {
4848
progress1->set_value(progress1->value() + 1);
4949
if (progress1->value() == progress1->max())
5050
progress1->set_value(progress1->min());

Games/Minesweeper/Field.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Field::Field(GLabel& flag_label, GLabel& time_label, GButton& face_button, GWidg
101101
, m_on_size_changed(move(on_size_changed))
102102
{
103103
srand(time(nullptr));
104-
m_timer = CTimer::create();
104+
m_timer = CTimer::construct();
105105
m_timer->on_timeout = [this] {
106106
++m_time_elapsed;
107107
m_time_label.set_text(String::format("%u.%u", m_time_elapsed / 10, m_time_elapsed % 10));

Libraries/LibCore/CTimer.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
class CTimer final : public CObject {
88
C_OBJECT(CTimer)
99
public:
10-
static ObjectPtr<CTimer> create(CObject* parent = nullptr)
11-
{
12-
return new CTimer(parent);
13-
}
14-
15-
static ObjectPtr<CTimer> create(int interval, Function<void()>&& timeout_handler, CObject* parent = nullptr)
16-
{
17-
return new CTimer(interval, move(timeout_handler), parent);
18-
}
19-
2010
virtual ~CTimer() override;
2111

2212
void start();

Libraries/LibGUI/GAbstractButton.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ GAbstractButton::GAbstractButton(const StringView& text, GWidget* parent)
1010
: GWidget(parent)
1111
, m_text(text)
1212
{
13-
m_auto_repeat_timer = CTimer::create(this);
13+
m_auto_repeat_timer = CTimer::construct(this);
1414
m_auto_repeat_timer->on_timeout = [this] {
1515
click();
1616
};

0 commit comments

Comments
 (0)