summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2023-02-11 21:19:00 +0100
committerLinus Groh <mail@linusgroh.de>2023-02-13 00:45:09 +0000
commitb5cb9a9ebb0c1203b9f47479b7fc15f9af8e421e (patch)
tree8fd24fba4e3fd54d07ee61caeea4152901a5882f /Userland/Services
parentf802920a3aab0d553470176f11d13c42be3c5016 (diff)
downloadserenity-b5cb9a9ebb0c1203b9f47479b7fc15f9af8e421e.zip
LibGUI+TaskBar: Make Calendar::formatted_date() return ErrorOr<String>
This commit introduces no error propagation.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/Taskbar/ClockWidget.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Services/Taskbar/ClockWidget.cpp b/Userland/Services/Taskbar/ClockWidget.cpp
index 033e5d3cea..36d7569998 100644
--- a/Userland/Services/Taskbar/ClockWidget.cpp
+++ b/Userland/Services/Taskbar/ClockWidget.cpp
@@ -71,9 +71,9 @@ ClockWidget::ClockWidget()
}
m_calendar->update_tiles(view_year, view_month);
if (m_calendar->mode() == GUI::Calendar::Year)
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date(GUI::Calendar::YearOnly));
+ m_selected_calendar_button->set_text(m_calendar->formatted_date(GUI::Calendar::YearOnly).release_value_but_fixme_should_propagate_errors());
else
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date());
+ m_selected_calendar_button->set_text(m_calendar->formatted_date().release_value_but_fixme_should_propagate_errors());
};
m_selected_calendar_button = navigation_container.add<GUI::Button>();
@@ -82,9 +82,9 @@ ClockWidget::ClockWidget()
m_selected_calendar_button->on_click = [&](auto) {
m_calendar->toggle_mode();
if (m_calendar->mode() == GUI::Calendar::Year)
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date(GUI::Calendar::YearOnly));
+ m_selected_calendar_button->set_text(m_calendar->formatted_date(GUI::Calendar::YearOnly).release_value_but_fixme_should_propagate_errors());
else
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date());
+ m_selected_calendar_button->set_text(m_calendar->formatted_date().release_value_but_fixme_should_propagate_errors());
};
m_next_date = navigation_container.add<GUI::Button>();
@@ -105,9 +105,9 @@ ClockWidget::ClockWidget()
}
m_calendar->update_tiles(view_year, view_month);
if (m_calendar->mode() == GUI::Calendar::Year)
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date(GUI::Calendar::YearOnly));
+ m_selected_calendar_button->set_text(m_calendar->formatted_date(GUI::Calendar::YearOnly).release_value_but_fixme_should_propagate_errors());
else
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date());
+ m_selected_calendar_button->set_text(m_calendar->formatted_date().release_value_but_fixme_should_propagate_errors());
};
auto& separator1 = root_container->add<GUI::HorizontalSeparator>();
@@ -118,14 +118,14 @@ ClockWidget::ClockWidget()
calendar_container.layout()->set_margins({ 2 });
m_calendar = calendar_container.add<GUI::Calendar>();
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date());
+ m_selected_calendar_button->set_text(m_calendar->formatted_date().release_value_but_fixme_should_propagate_errors());
m_calendar->on_tile_click = [&] {
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date());
+ m_selected_calendar_button->set_text(m_calendar->formatted_date().release_value_but_fixme_should_propagate_errors());
};
m_calendar->on_month_click = [&] {
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date());
+ m_selected_calendar_button->set_text(m_calendar->formatted_date().release_value_but_fixme_should_propagate_errors());
};
auto& separator2 = root_container->add<GUI::HorizontalSeparator>();
@@ -238,7 +238,7 @@ void ClockWidget::jump_to_current_date()
m_calendar->toggle_mode();
m_calendar->set_selected_date(Core::DateTime::now());
m_calendar->update_tiles(Core::DateTime::now().year(), Core::DateTime::now().month());
- m_selected_calendar_button->set_text_deprecated(m_calendar->formatted_date());
+ m_selected_calendar_button->set_text(m_calendar->formatted_date().release_value_but_fixme_should_propagate_errors());
}
}