diff --git a/Userland/Applications/Calculator/CalculatorWidget.cpp b/Userland/Applications/Calculator/CalculatorWidget.cpp index 385df9bee9..e10f048ecb 100644 --- a/Userland/Applications/Calculator/CalculatorWidget.cpp +++ b/Userland/Applications/Calculator/CalculatorWidget.cpp @@ -28,7 +28,7 @@ CalculatorWidget::CalculatorWidget() m_label->set_frame_style(Gfx::FrameStyle::SunkenContainer); for (int i = 0; i < 10; i++) { - m_digit_button[i] = *find_descendant_of_type_named(DeprecatedString::formatted("{}_button", i)); + m_digit_button[i] = *find_descendant_of_type_named(String::formatted("{}_button", i).release_value_but_fixme_should_propagate_errors()); add_digit_button(*m_digit_button[i], i); } @@ -128,9 +128,9 @@ void CalculatorWidget::add_digit_button(GUI::Button& button, int digit) }; } -DeprecatedString CalculatorWidget::get_entry() +String CalculatorWidget::get_entry() { - return m_entry->text(); + return String::from_deprecated_string(m_entry->text()).release_value_but_fixme_should_propagate_errors(); } void CalculatorWidget::set_entry(Crypto::BigFraction value) @@ -147,7 +147,7 @@ void CalculatorWidget::set_typed_entry(Crypto::BigFraction value) void CalculatorWidget::update_display() { - m_entry->set_text(m_keypad.to_deprecated_string()); + m_entry->set_text(m_keypad.to_string().release_value_but_fixme_should_propagate_errors()); if (m_calculator.has_error()) m_label->set_text("E"_string); else diff --git a/Userland/Applications/Calculator/CalculatorWidget.h b/Userland/Applications/Calculator/CalculatorWidget.h index 1333a8581d..603b70d0de 100644 --- a/Userland/Applications/Calculator/CalculatorWidget.h +++ b/Userland/Applications/Calculator/CalculatorWidget.h @@ -19,7 +19,7 @@ class CalculatorWidget final : public GUI::Widget { C_OBJECT(CalculatorWidget) public: virtual ~CalculatorWidget() override = default; - DeprecatedString get_entry(); + String get_entry(); void set_entry(Crypto::BigFraction); void set_typed_entry(Crypto::BigFraction); diff --git a/Userland/Applications/Calculator/Keypad.cpp b/Userland/Applications/Calculator/Keypad.cpp index e8e2c04ad2..df1c1b1751 100644 --- a/Userland/Applications/Calculator/Keypad.cpp +++ b/Userland/Applications/Calculator/Keypad.cpp @@ -121,10 +121,10 @@ void Keypad::set_to_0() m_state = State::External; } -DeprecatedString Keypad::to_deprecated_string() const +ErrorOr Keypad::to_string() const { if (m_state == State::External || m_state == State::TypedExternal) - return m_internal_value.to_deprecated_string(m_displayed_fraction_length); + return String::from_deprecated_string(m_internal_value.to_deprecated_string(m_displayed_fraction_length)); StringBuilder builder; @@ -142,7 +142,7 @@ DeprecatedString Keypad::to_deprecated_string() const builder.append(frac_value); } - return builder.to_deprecated_string(); + return builder.to_string(); } bool Keypad::in_typing_state() const diff --git a/Userland/Applications/Calculator/Keypad.h b/Userland/Applications/Calculator/Keypad.h index 3ef3be3a9d..a5d860c4b5 100644 --- a/Userland/Applications/Calculator/Keypad.h +++ b/Userland/Applications/Calculator/Keypad.h @@ -7,7 +7,7 @@ #pragma once -#include +#include #include #include @@ -34,7 +34,7 @@ public: void set_rounding_length(unsigned); unsigned rounding_length() const; - DeprecatedString to_deprecated_string() const; + ErrorOr to_string() const; bool in_typing_state() const;