From 34344120f2de8946c55224c407e10c14807aca2f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 7 Aug 2023 11:12:38 +0200 Subject: [PATCH] AK: Make "foo"_string infallible Stop worrying about tiny OOMs. Work towards #20405. --- AK/String.h | 4 +- .../LibWeb/GenerateCSSMathFunctions.cpp | 18 +-- Tests/AK/TestFlyString.cpp | 16 +-- Tests/AK/TestString.cpp | 116 +++++++++--------- Tests/AK/TestUtf16.cpp | 2 +- Userland/Applications/3DFileViewer/main.cpp | 8 +- Userland/Applications/About/main.cpp | 2 +- .../Browser/BookmarksBarWidget.cpp | 2 +- .../Applications/Browser/BrowserWindow.cpp | 26 ++-- .../Applications/Browser/CookiesModel.cpp | 4 +- .../Applications/Browser/DownloadWidget.cpp | 4 +- .../Applications/Browser/InspectorWidget.cpp | 12 +- Userland/Applications/Browser/Tab.cpp | 4 +- .../Applications/Browser/WindowActions.cpp | 14 +-- .../BrowserSettings/BrowserSettingsWidget.cpp | 2 +- .../Applications/BrowserSettings/main.cpp | 4 +- Userland/Applications/Calculator/main.cpp | 2 +- .../Applications/Calendar/AddEventDialog.cpp | 4 +- .../Applications/CalendarSettings/main.cpp | 2 +- .../CertificateStoreWidget.cpp | 6 +- .../Applications/CertificateSettings/main.cpp | 2 +- .../CharacterMap/CharacterMapWidget.cpp | 8 +- Userland/Applications/ClockSettings/main.cpp | 2 +- Userland/Applications/CrashReporter/main.cpp | 12 +- .../DisplaySettings/DesktopSettingsWidget.cpp | 2 +- .../Applications/DisplaySettings/main.cpp | 4 +- .../FileOperationProgressWidget.cpp | 12 +- .../FileManager/PropertiesWindow.cpp | 20 +-- Userland/Applications/FileManager/main.cpp | 16 +-- .../Applications/FontEditor/MainWidget.cpp | 30 ++--- Userland/Applications/FontEditor/main.cpp | 2 +- Userland/Applications/Help/MainWidget.cpp | 2 +- .../HexEditor/HexEditorWidget.cpp | 4 +- .../HexEditor/ValueInspectorModel.h | 2 +- Userland/Applications/HexEditor/main.cpp | 2 +- Userland/Applications/ImageViewer/main.cpp | 6 +- .../KeyboardMapper/KeyboardMapperWidget.cpp | 2 +- Userland/Applications/KeyboardMapper/main.cpp | 4 +- .../Applications/KeyboardSettings/main.cpp | 2 +- Userland/Applications/Magnifier/main.cpp | 2 +- Userland/Applications/MouseSettings/main.cpp | 4 +- .../PDFViewer/PDFViewerWidget.cpp | 10 +- .../Applications/PDFViewer/SidebarWidget.cpp | 2 +- Userland/Applications/PDFViewer/main.cpp | 2 +- .../PartitionEditor/PartitionModel.cpp | 8 +- Userland/Applications/Piano/MainWidget.cpp | 2 +- Userland/Applications/Piano/SamplerWidget.cpp | 2 +- .../PixelPaint/CreateNewImageDialog.cpp | 4 +- .../Applications/PixelPaint/FilterParams.h | 2 +- .../Applications/PixelPaint/Filters/Bloom.cpp | 6 +- .../PixelPaint/Filters/FastBoxBlur.cpp | 14 +-- .../Applications/PixelPaint/Filters/Sepia.cpp | 2 +- .../Applications/PixelPaint/ImageEditor.cpp | 2 +- .../PixelPaint/LayerPropertiesWidget.cpp | 2 +- .../Applications/PixelPaint/MainWidget.cpp | 6 +- .../PixelPaint/Tools/BrushTool.cpp | 2 +- .../PixelPaint/Tools/BucketTool.cpp | 2 +- .../PixelPaint/Tools/CloneTool.cpp | 2 +- .../PixelPaint/Tools/EllipseTool.cpp | 6 +- .../PixelPaint/Tools/EraseTool.cpp | 6 +- .../PixelPaint/Tools/GradientTool.cpp | 8 +- .../PixelPaint/Tools/GuideTool.cpp | 2 +- .../PixelPaint/Tools/LineTool.cpp | 4 +- .../PixelPaint/Tools/MoveTool.cpp | 6 +- .../Applications/PixelPaint/Tools/PenTool.cpp | 2 +- .../PixelPaint/Tools/PickerTool.cpp | 2 +- .../PixelPaint/Tools/RectangleSelectTool.cpp | 2 +- .../PixelPaint/Tools/RectangleTool.cpp | 6 +- .../PixelPaint/Tools/SprayTool.cpp | 2 +- .../PixelPaint/Tools/TextTool.cpp | 4 +- .../PixelPaint/Tools/WandSelectTool.cpp | 2 +- .../PixelPaint/Tools/ZoomTool.cpp | 2 +- .../Presenter/PresenterWidget.cpp | 2 +- .../SoundPlayer/PlaylistWidget.cpp | 4 +- Userland/Applications/SoundPlayer/main.cpp | 6 +- .../SpaceAnalyzer/ProgressWindow.cpp | 2 +- .../SpaceAnalyzer/TreeMapWidget.cpp | 2 +- .../Spreadsheet/CellTypeDialog.cpp | 16 +-- .../Applications/Spreadsheet/ImportDialog.cpp | 2 +- Userland/Applications/Spreadsheet/main.cpp | 2 +- .../SystemMonitor/MemoryStatsWidget.cpp | 12 +- .../SystemMonitor/NetworkStatisticsWidget.cpp | 10 +- .../ProcessFileDescriptorMapWidget.cpp | 6 +- .../SystemMonitor/ProcessMemoryMapWidget.cpp | 8 +- .../SystemMonitor/ProcessModel.cpp | 12 +- .../ProcessUnveiledPathsWidget.cpp | 2 +- Userland/Applications/SystemMonitor/main.cpp | 18 +-- Userland/Applications/Terminal/main.cpp | 10 +- .../Applications/TerminalSettings/main.cpp | 2 +- .../Applications/TextEditor/MainWidget.cpp | 22 ++-- Userland/Applications/TextEditor/main.cpp | 2 +- Userland/Applications/ThemeEditor/main.cpp | 2 +- .../VideoPlayer/VideoPlayerWidget.cpp | 4 +- Userland/Applications/VideoPlayer/main.cpp | 2 +- Userland/Demos/ModelGallery/GalleryWidget.cpp | 2 +- Userland/DevTools/GMLPlayground/main.cpp | 2 +- .../HackStudio/Debugger/DebugInfoWidget.cpp | 4 +- .../HackStudio/Debugger/DisassemblyModel.cpp | 4 +- .../HackStudio/Debugger/DisassemblyWidget.cpp | 2 +- .../HackStudio/Debugger/RegistersModel.cpp | 2 +- .../HackStudio/Dialogs/NewProjectDialog.cpp | 4 +- .../DevTools/HackStudio/FindInFilesWidget.cpp | 4 +- .../DevTools/HackStudio/GMLPreviewWidget.cpp | 4 +- .../DevTools/HackStudio/Git/GitWidget.cpp | 2 +- .../DevTools/HackStudio/HackStudioWidget.cpp | 16 +-- .../DevTools/HackStudio/ToDoEntriesWidget.cpp | 2 +- .../DevTools/Profiler/DisassemblyModel.cpp | 8 +- .../Profiler/FilesystemEventModel.cpp | 4 +- Userland/DevTools/Profiler/ProfileModel.cpp | 6 +- Userland/DevTools/Profiler/SamplesModel.cpp | 8 +- Userland/DevTools/Profiler/SignpostsModel.cpp | 6 +- Userland/DevTools/Profiler/SourceModel.cpp | 6 +- Userland/DevTools/Profiler/main.cpp | 10 +- Userland/DevTools/SQLStudio/MainWidget.cpp | 4 +- Userland/Games/Chess/main.cpp | 2 +- Userland/Games/GameOfLife/BoardWidget.cpp | 2 +- Userland/Games/GameOfLife/main.cpp | 6 +- Userland/Games/Hearts/Game.cpp | 12 +- Userland/Games/Hearts/main.cpp | 2 +- Userland/Games/MasterWord/main.cpp | 2 +- Userland/Games/Minesweeper/main.cpp | 2 +- Userland/Games/Snake/main.cpp | 2 +- Userland/Games/Solitaire/main.cpp | 14 +-- Userland/Games/Spider/main.cpp | 8 +- Userland/Libraries/LibCards/CardGame.cpp | 2 +- .../Shell/ShellComprehensionEngine.cpp | 2 +- Userland/Libraries/LibCore/StandardPaths.cpp | 10 +- Userland/Libraries/LibGLSL/Linker.cpp | 4 +- .../Libraries/LibGUI/AutocompleteProvider.cpp | 2 +- Userland/Libraries/LibGUI/ColorPicker.cpp | 4 +- Userland/Libraries/LibGUI/CommonActions.cpp | 34 ++--- Userland/Libraries/LibGUI/CommonMenus.cpp | 2 +- Userland/Libraries/LibGUI/FileSystemModel.cpp | 4 +- Userland/Libraries/LibGUI/MessageBox.cpp | 2 +- Userland/Libraries/LibGUI/SettingsWindow.cpp | 2 +- Userland/Libraries/LibGUI/Toolbar.cpp | 2 +- .../Libraries/LibJS/Bytecode/Interpreter.cpp | 2 +- Userland/Libraries/LibJS/Console.cpp | 10 +- Userland/Libraries/LibJS/Lexer.cpp | 2 +- .../LibJS/Runtime/ErrorPrototype.cpp | 4 +- .../LibJS/Runtime/Intl/AbstractOperations.cpp | 4 +- .../Runtime/Intl/CollatorConstructor.cpp | 2 +- .../Runtime/Temporal/AbstractOperations.cpp | 8 +- .../LibJS/Runtime/Temporal/Calendar.cpp | 20 +-- .../Runtime/Temporal/DurationPrototype.cpp | 2 +- .../LibJS/Runtime/Temporal/PlainTime.cpp | 12 +- .../LibJS/Runtime/Temporal/ZonedDateTime.cpp | 4 +- .../Temporal/ZonedDateTimePrototype.cpp | 4 +- Userland/Libraries/LibJS/Runtime/VM.cpp | 2 +- Userland/Libraries/LibJS/Runtime/Value.cpp | 6 +- Userland/Libraries/LibManual/PageNode.cpp | 2 +- .../LibWeb/Fetch/Fetching/Fetching.cpp | 26 ++-- .../Fetch/Infrastructure/HTTP/Headers.cpp | 2 +- Userland/Libraries/LibWeb/Fetch/Request.cpp | 2 +- .../CustomElements/CustomElementRegistry.cpp | 4 +- .../LibWeb/HTML/FormControlInfrastructure.cpp | 6 +- .../LibWeb/HTML/HTMLMediaElement.cpp | 4 +- .../Libraries/LibWeb/HTML/MessagePort.cpp | 2 +- Userland/Libraries/LibWeb/HTML/MimeType.cpp | 4 +- Userland/Libraries/LibWeb/HTML/MimeType.h | 2 +- Userland/Libraries/LibWeb/HTML/Plugin.cpp | 8 +- Userland/Libraries/LibWeb/HTML/Plugin.h | 4 +- Userland/Libraries/LibWeb/HTML/Window.cpp | 16 +-- Userland/Libraries/LibWeb/HTML/Worker.cpp | 2 +- Userland/Libraries/LibWeb/HTML/Worker.h | 4 +- .../LibWeb/UIEvents/KeyboardEvent.cpp | 2 +- .../Libraries/LibWeb/WebSockets/WebSocket.h | 2 +- .../Libraries/LibWeb/XHR/XMLHttpRequest.cpp | 6 +- Userland/Services/ChessEngine/ChessEngine.cpp | 4 +- Userland/Services/Taskbar/ShutdownDialog.cpp | 2 +- Userland/Services/Taskbar/TaskbarWindow.cpp | 2 +- Userland/Services/WebServer/Client.cpp | 4 +- Userland/Services/WebServer/main.cpp | 4 +- Userland/Services/WindowServer/Window.cpp | 2 +- Userland/Shell/Builtin.cpp | 4 +- Userland/Shell/ImmediateFunctions.cpp | 14 +-- Userland/Shell/Parser.cpp | 102 +++++++-------- Userland/Shell/PosixParser.cpp | 44 +++---- Userland/Shell/Shell.cpp | 4 +- Userland/Utilities/man.cpp | 2 +- Userland/Utilities/mktemp.cpp | 2 +- 181 files changed, 626 insertions(+), 630 deletions(-) diff --git a/AK/String.h b/AK/String.h index faab55917ff..e60b174c343 100644 --- a/AK/String.h +++ b/AK/String.h @@ -280,9 +280,9 @@ struct Formatter : Formatter { } -[[nodiscard]] ALWAYS_INLINE AK::ErrorOr operator""_string(char const* cstring, size_t length) +[[nodiscard]] ALWAYS_INLINE AK::String operator""_string(char const* cstring, size_t length) { - return AK::String::from_utf8(AK::StringView(cstring, length)); + return AK::String::from_utf8(AK::StringView(cstring, length)).release_value(); } [[nodiscard]] ALWAYS_INLINE AK_SHORT_STRING_CONSTEVAL AK::String operator""_short_string(char const* cstring, size_t length) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp index 1092517ffcb..5cb134a08f5 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSMathFunctions.cpp @@ -242,10 +242,10 @@ ErrorOr> Parser::parse_math_function(PropertyID property bool parameter_is_calculation; if (parameter_type_string == "") { parameter_is_calculation = false; - TRY(parameter_generator.set("parameter_type", TRY("RoundingStrategy"_string))); - TRY(parameter_generator.set("parse_function", TRY("parse_rounding_strategy(arguments[argument_index])"_string))); - TRY(parameter_generator.set("check_function", TRY(".has_value()"_string))); - TRY(parameter_generator.set("release_function", TRY(".release_value()"_string))); + TRY(parameter_generator.set("parameter_type", "RoundingStrategy"_string)); + TRY(parameter_generator.set("parse_function", "parse_rounding_strategy(arguments[argument_index])"_string)); + TRY(parameter_generator.set("check_function", ".has_value()"_string)); + TRY(parameter_generator.set("release_function", ".release_value()"_string)); if (auto default_value = parameter.get_deprecated_string("default"sv); default_value.has_value()) { TRY(parameter_generator.set("parameter_default", TRY(String::formatted(" = RoundingStrategy::{}", TRY(title_casify(default_value.value())))))); } else { @@ -254,10 +254,10 @@ ErrorOr> Parser::parse_math_function(PropertyID property } else { // NOTE: This assumes everything not handled above is a calculation node of some kind. parameter_is_calculation = true; - TRY(parameter_generator.set("parameter_type", TRY("OwnPtr"_string))); - TRY(parameter_generator.set("parse_function", TRY("TRY(parse_a_calculation(arguments[argument_index]))"_string))); - TRY(parameter_generator.set("check_function", TRY(" != nullptr"_string))); - TRY(parameter_generator.set("release_function", TRY(".release_nonnull()"_string))); + TRY(parameter_generator.set("parameter_type", "OwnPtr"_string)); + TRY(parameter_generator.set("parse_function", "TRY(parse_a_calculation(arguments[argument_index]))"_string)); + TRY(parameter_generator.set("check_function", " != nullptr"_string)); + TRY(parameter_generator.set("release_function", ".release_nonnull()"_string)); // NOTE: We have exactly one default value in the data right now, and it's a ``, // so that's all we handle. @@ -354,7 +354,7 @@ ErrorOr> Parser::parse_math_function(PropertyID property TRY(parameter_generator.set("release_value"sv, ""_short_string)); } else { // NOTE: This assumes everything not handled above is a calculation node of some kind. - TRY(parameter_generator.set("release_value"sv, TRY(".release_nonnull()"_string))); + TRY(parameter_generator.set("release_value"sv, ".release_nonnull()"_string)); } if (parameter_index == 0) { diff --git a/Tests/AK/TestFlyString.cpp b/Tests/AK/TestFlyString.cpp index dc182c2b8f1..f62cf58a46a 100644 --- a/Tests/AK/TestFlyString.cpp +++ b/Tests/AK/TestFlyString.cpp @@ -22,13 +22,13 @@ TEST_CASE(empty_string) TEST_CASE(short_string) { - FlyString fly1 { MUST("foo"_string) }; + FlyString fly1 { "foo"_string }; EXPECT_EQ(fly1, "foo"sv); - FlyString fly2 { MUST("foo"_string) }; + FlyString fly2 { "foo"_string }; EXPECT_EQ(fly2, "foo"sv); - FlyString fly3 { MUST("bar"_string) }; + FlyString fly3 { "bar"_string }; EXPECT_EQ(fly3, "bar"sv); EXPECT_EQ(fly1, fly2); @@ -45,15 +45,15 @@ TEST_CASE(short_string) TEST_CASE(long_string) { - FlyString fly1 { MUST("thisisdefinitelymorethan7bytes"_string) }; + FlyString fly1 { "thisisdefinitelymorethan7bytes"_string }; EXPECT_EQ(fly1, "thisisdefinitelymorethan7bytes"sv); EXPECT_EQ(FlyString::number_of_fly_strings(), 1u); - FlyString fly2 { MUST("thisisdefinitelymorethan7bytes"_string) }; + FlyString fly2 { "thisisdefinitelymorethan7bytes"_string }; EXPECT_EQ(fly2, "thisisdefinitelymorethan7bytes"sv); EXPECT_EQ(FlyString::number_of_fly_strings(), 1u); - FlyString fly3 { MUST("thisisalsoforsuremorethan7bytes"_string) }; + FlyString fly3 { "thisisalsoforsuremorethan7bytes"_string }; EXPECT_EQ(fly3, "thisisalsoforsuremorethan7bytes"sv); EXPECT_EQ(FlyString::number_of_fly_strings(), 2u); @@ -91,7 +91,7 @@ TEST_CASE(fly_string_keep_string_data_alive) { FlyString fly {}; { - auto string = MUST("thisisdefinitelymorethan7bytes"_string); + auto string = "thisisdefinitelymorethan7bytes"_string; fly = FlyString { string }; EXPECT_EQ(FlyString::number_of_fly_strings(), 1u); } @@ -108,7 +108,7 @@ TEST_CASE(moved_fly_string_becomes_empty) FlyString fly1 {}; EXPECT(fly1.is_empty()); - FlyString fly2 { MUST("thisisdefinitelymorethan7bytes"_string) }; + FlyString fly2 { "thisisdefinitelymorethan7bytes"_string }; EXPECT_EQ(fly2, "thisisdefinitelymorethan7bytes"sv); EXPECT_EQ(FlyString::number_of_fly_strings(), 1u); diff --git a/Tests/AK/TestString.cpp b/Tests/AK/TestString.cpp index 9994fc16c85..bb10f573c64 100644 --- a/Tests/AK/TestString.cpp +++ b/Tests/AK/TestString.cpp @@ -23,7 +23,7 @@ TEST_CASE(construct_empty) EXPECT_EQ(empty.bytes().size(), 0u); EXPECT_EQ(empty, ""sv); - auto empty2 = MUST(""_string); + auto empty2 = ""_string; EXPECT(empty2.is_empty()); EXPECT_EQ(empty, empty2); @@ -34,8 +34,8 @@ TEST_CASE(construct_empty) TEST_CASE(move_assignment) { - String string1 = MUST("hello"_string); - string1 = MUST("friends!"_string); + String string1 = "hello"_string; + string1 = "friends!"_string; EXPECT_EQ(string1, "friends!"sv); } @@ -52,7 +52,7 @@ TEST_CASE(short_strings) EXPECT_EQ(string2.bytes().size(), 7u); EXPECT_EQ(string2, string1); - auto string3 = MUST("abcdefg"_string); + auto string3 = "abcdefg"_string; EXPECT_EQ(string3.is_short_string(), true); EXPECT_EQ(string3.bytes().size(), 7u); EXPECT_EQ(string3, string1); @@ -72,7 +72,7 @@ TEST_CASE(short_strings) EXPECT_EQ(string2.bytes().size(), 3u); EXPECT_EQ(string2, string1); - auto string3 = MUST("abc"_string); + auto string3 = "abc"_string; EXPECT_EQ(string3.is_short_string(), true); EXPECT_EQ(string3.bytes().size(), 3u); EXPECT_EQ(string3, string1); @@ -182,7 +182,7 @@ TEST_CASE(from_code_points) TEST_CASE(substring) { - auto superstring = MUST("Hello I am a long string"_string); + auto superstring = "Hello I am a long string"_string; auto short_substring = MUST(superstring.substring_from_byte_offset(0, 5)); EXPECT_EQ(short_substring, "Hello"sv); @@ -192,7 +192,7 @@ TEST_CASE(substring) TEST_CASE(substring_with_shared_superstring) { - auto superstring = MUST("Hello I am a long string"_string); + auto superstring = "Hello I am a long string"_string; auto substring1 = MUST(superstring.substring_from_byte_offset_with_shared_superstring(0, 5)); EXPECT_EQ(substring1, "Hello"sv); @@ -203,7 +203,7 @@ TEST_CASE(substring_with_shared_superstring) TEST_CASE(code_points) { - auto string = MUST("🦬🪒"_string); + auto string = "🦬🪒"_string; Vector code_points; for (auto code_point : string.code_points()) @@ -226,20 +226,20 @@ TEST_CASE(string_builder) TEST_CASE(ak_format) { - auto foo = MUST(String::formatted("Hello {}", MUST("friends"_string))); + auto foo = MUST(String::formatted("Hello {}", "friends"_string)); EXPECT_EQ(foo, "Hello friends"sv); } TEST_CASE(replace) { { - auto haystack = MUST("Hello enemies"_string); + auto haystack = "Hello enemies"_string; auto result = MUST(haystack.replace("enemies"sv, "friends"sv, ReplaceMode::All)); EXPECT_EQ(result, "Hello friends"sv); } { - auto base_title = MUST("anon@courage:~"_string); + auto base_title = "anon@courage:~"_string; auto result = MUST(base_title.replace("[*]"sv, "(*)"sv, ReplaceMode::FirstOnly)); EXPECT_EQ(result, "anon@courage:~"sv); } @@ -265,17 +265,17 @@ TEST_CASE(reverse) TEST_CASE(to_lowercase) { { - auto string = MUST("Aa"_string); + auto string = "Aa"_string; auto result = MUST(string.to_lowercase()); EXPECT_EQ(result, "aa"sv); } { - auto string = MUST("Ωω"_string); + auto string = "Ωω"_string; auto result = MUST(string.to_lowercase()); EXPECT_EQ(result, "ωω"sv); } { - auto string = MUST("İi̇"_string); + auto string = "İi̇"_string; auto result = MUST(string.to_lowercase()); EXPECT_EQ(result, "i̇i̇"sv); } @@ -284,17 +284,17 @@ TEST_CASE(to_lowercase) TEST_CASE(to_uppercase) { { - auto string = MUST("Aa"_string); + auto string = "Aa"_string; auto result = MUST(string.to_uppercase()); EXPECT_EQ(result, "AA"sv); } { - auto string = MUST("Ωω"_string); + auto string = "Ωω"_string; auto result = MUST(string.to_uppercase()); EXPECT_EQ(result, "ΩΩ"sv); } { - auto string = MUST("ʼn"_string); + auto string = "ʼn"_string; auto result = MUST(string.to_uppercase()); EXPECT_EQ(result, "ʼN"sv); } @@ -303,22 +303,22 @@ TEST_CASE(to_uppercase) TEST_CASE(to_titlecase) { { - auto string = MUST("foo bar baz"_string); + auto string = "foo bar baz"_string; auto result = MUST(string.to_titlecase()); EXPECT_EQ(result, "Foo Bar Baz"sv); } { - auto string = MUST("foo \n \r bar \t baz"_string); + auto string = "foo \n \r bar \t baz"_string; auto result = MUST(string.to_titlecase()); EXPECT_EQ(result, "Foo \n \r Bar \t Baz"sv); } { - auto string = MUST("f\"oo\" b'ar'"_string); + auto string = "f\"oo\" b'ar'"_string; auto result = MUST(string.to_titlecase()); EXPECT_EQ(result, "F\"Oo\" B'ar'"sv); } { - auto string = MUST("123dollars"_string); + auto string = "123dollars"_string; auto result = MUST(string.to_titlecase()); EXPECT_EQ(result, "123Dollars"sv); } @@ -333,12 +333,12 @@ TEST_CASE(equals_ignoring_case) EXPECT(string1.equals_ignoring_case(string2)); } { - auto string1 = MUST("abcd"_string); - auto string2 = MUST("ABCD"_string); - auto string3 = MUST("AbCd"_string); - auto string4 = MUST("dcba"_string); - auto string5 = MUST("abce"_string); - auto string6 = MUST("abc"_string); + auto string1 = "abcd"_string; + auto string2 = "ABCD"_string; + auto string3 = "AbCd"_string; + auto string4 = "dcba"_string; + auto string5 = "abce"_string; + auto string6 = "abc"_string; EXPECT(string1.equals_ignoring_case(string2)); EXPECT(string1.equals_ignoring_case(string3)); @@ -359,12 +359,12 @@ TEST_CASE(equals_ignoring_case) EXPECT(!string3.equals_ignoring_case(string6)); } { - auto string1 = MUST("\u00DF"_string); // LATIN SMALL LETTER SHARP S - auto string2 = MUST("SS"_string); - auto string3 = MUST("Ss"_string); - auto string4 = MUST("ss"_string); - auto string5 = MUST("S"_string); - auto string6 = MUST("s"_string); + auto string1 = "\u00DF"_string; // LATIN SMALL LETTER SHARP S + auto string2 = "SS"_string; + auto string3 = "Ss"_string; + auto string4 = "ss"_string; + auto string5 = "S"_string; + auto string6 = "s"_string; EXPECT(string1.equals_ignoring_case(string2)); EXPECT(string1.equals_ignoring_case(string3)); @@ -392,12 +392,12 @@ TEST_CASE(equals_ignoring_case) } { - auto string1 = MUST("Ab\u00DFCd\u00DFeF"_string); - auto string2 = MUST("ABSSCDSSEF"_string); - auto string3 = MUST("absscdssef"_string); - auto string4 = MUST("aBSscDsSEf"_string); - auto string5 = MUST("Ab\u00DFCd\u00DFeg"_string); - auto string6 = MUST("Ab\u00DFCd\u00DFe"_string); + auto string1 = "Ab\u00DFCd\u00DFeF"_string; + auto string2 = "ABSSCDSSEF"_string; + auto string3 = "absscdssef"_string; + auto string4 = "aBSscDsSEf"_string; + auto string5 = "Ab\u00DFCd\u00DFeg"_string; + auto string6 = "Ab\u00DFCd\u00DFe"_string; EXPECT(string1.equals_ignoring_case(string1)); EXPECT(string1.equals_ignoring_case(string2)); @@ -431,8 +431,8 @@ TEST_CASE(equals_ignoring_case) TEST_CASE(is_one_of) { - auto foo = MUST("foo"_string); - auto bar = MUST("bar"_string); + auto foo = "foo"_string; + auto bar = "bar"_string; EXPECT(foo.is_one_of(foo)); EXPECT(foo.is_one_of(foo, bar)); @@ -448,7 +448,7 @@ TEST_CASE(is_one_of) TEST_CASE(split) { { - auto test = MUST("foo bar baz"_string); + auto test = "foo bar baz"_string; auto parts = MUST(test.split(' ')); EXPECT_EQ(parts.size(), 3u); EXPECT_EQ(parts[0], "foo"); @@ -456,7 +456,7 @@ TEST_CASE(split) EXPECT_EQ(parts[2], "baz"); } { - auto test = MUST("ωΣ2ωΣω"_string); + auto test = "ωΣ2ωΣω"_string; auto parts = MUST(test.split(0x03A3u)); EXPECT_EQ(parts.size(), 3u); EXPECT_EQ(parts[0], "ω"sv); @@ -476,7 +476,7 @@ TEST_CASE(find_byte_offset) EXPECT(!index2.has_value()); } { - auto string = MUST("foo"_string); + auto string = "foo"_string; auto index1 = string.find_byte_offset('f'); EXPECT_EQ(index1, 0u); @@ -491,7 +491,7 @@ TEST_CASE(find_byte_offset) EXPECT(!index4.has_value()); } { - auto string = MUST("foo"_string); + auto string = "foo"_string; auto index1 = string.find_byte_offset("fo"sv); EXPECT_EQ(index1, 0u); @@ -506,7 +506,7 @@ TEST_CASE(find_byte_offset) EXPECT(!index4.has_value()); } { - auto string = MUST("ωΣωΣω"_string); + auto string = "ωΣωΣω"_string; auto index1 = string.find_byte_offset(0x03C9U); EXPECT_EQ(index1, 0u); @@ -524,7 +524,7 @@ TEST_CASE(find_byte_offset) EXPECT_EQ(index5, 8u); } { - auto string = MUST("ωΣωΣω"_string); + auto string = "ωΣωΣω"_string; auto index1 = string.find_byte_offset("ω"sv); EXPECT_EQ(index1, 0u); @@ -660,7 +660,7 @@ TEST_CASE(trim) EXPECT(result.is_empty()); } { - auto string = MUST("word"_string); + auto string = "word"_string; auto result = MUST(string.trim(" "sv, TrimMode::Both)); EXPECT_EQ(result, "word"sv); @@ -672,7 +672,7 @@ TEST_CASE(trim) EXPECT_EQ(result, "word"sv); } { - auto string = MUST(" word"_string); + auto string = " word"_string; auto result = MUST(string.trim(" "sv, TrimMode::Both)); EXPECT_EQ(result, "word"sv); @@ -684,7 +684,7 @@ TEST_CASE(trim) EXPECT_EQ(result, " word"sv); } { - auto string = MUST("word "_string); + auto string = "word "_string; auto result = MUST(string.trim(" "sv, TrimMode::Both)); EXPECT_EQ(result, "word"sv); @@ -696,7 +696,7 @@ TEST_CASE(trim) EXPECT_EQ(result, "word"sv); } { - auto string = MUST(" word "_string); + auto string = " word "_string; auto result = MUST(string.trim(" "sv, TrimMode::Both)); EXPECT_EQ(result, "word"sv); @@ -708,7 +708,7 @@ TEST_CASE(trim) EXPECT_EQ(result, " word"sv); } { - auto string = MUST(" word "_string); + auto string = " word "_string; auto result = MUST(string.trim("\t"sv, TrimMode::Both)); EXPECT_EQ(result, " word "sv); @@ -720,7 +720,7 @@ TEST_CASE(trim) EXPECT_EQ(result, " word "sv); } { - auto string = MUST("ωΣωΣω"_string); + auto string = "ωΣωΣω"_string; auto result = MUST(string.trim("ω"sv, TrimMode::Both)); EXPECT_EQ(result, "ΣωΣ"sv); @@ -732,7 +732,7 @@ TEST_CASE(trim) EXPECT_EQ(result, "ωΣωΣ"sv); } { - auto string = MUST("ωΣωΣω"_string); + auto string = "ωΣωΣω"_string; auto result = MUST(string.trim("ωΣ"sv, TrimMode::Both)); EXPECT(result.is_empty()); @@ -744,7 +744,7 @@ TEST_CASE(trim) EXPECT(result.is_empty()); } { - auto string = MUST("ωΣωΣω"_string); + auto string = "ωΣωΣω"_string; auto result = MUST(string.trim("Σω"sv, TrimMode::Both)); EXPECT(result.is_empty()); @@ -786,7 +786,7 @@ TEST_CASE(contains) EXPECT("abc"_short_string.contains(0x0063)); EXPECT(!"abc"_short_string.contains(0x0064)); - auto emoji = MUST("😀"_string); + auto emoji = "😀"_string; EXPECT(emoji.contains("\xF0"sv)); EXPECT(emoji.contains("\x9F"sv)); EXPECT(emoji.contains("\x98"sv)); @@ -828,7 +828,7 @@ TEST_CASE(starts_with) EXPECT(!"abc"_short_string.starts_with(0x0062)); EXPECT(!"abc"_short_string.starts_with(0x0063)); - auto emoji = MUST("😀🙃"_string); + auto emoji = "😀🙃"_string; EXPECT(emoji.starts_with_bytes("\xF0"sv)); EXPECT(emoji.starts_with_bytes("\xF0\x9F"sv)); EXPECT(emoji.starts_with_bytes("\xF0\x9F\x98"sv)); @@ -869,7 +869,7 @@ TEST_CASE(ends_with) EXPECT(!"abc"_short_string.ends_with(0x0062)); EXPECT(!"abc"_short_string.ends_with(0x0061)); - auto emoji = MUST("😀🙃"_string); + auto emoji = "😀🙃"_string; EXPECT(emoji.ends_with_bytes("\x83"sv)); EXPECT(emoji.ends_with_bytes("\x99\x83"sv)); EXPECT(emoji.ends_with_bytes("\x9F\x99\x83"sv)); diff --git a/Tests/AK/TestUtf16.cpp b/Tests/AK/TestUtf16.cpp index 302e5357e2f..b3053705968 100644 --- a/Tests/AK/TestUtf16.cpp +++ b/Tests/AK/TestUtf16.cpp @@ -53,7 +53,7 @@ TEST_CASE(decode_utf8) TEST_CASE(encode_utf8) { { - auto utf8_string = MUST("Привет, мир! 😀 γειά σου κόσμος こんにちは世界"_string); + auto utf8_string = "Привет, мир! 😀 γειά σου κόσμος こんにちは世界"_string; auto string = MUST(AK::utf8_to_utf16(utf8_string)); Utf16View view { string }; EXPECT_EQ(MUST(view.to_utf8(Utf16View::AllowInvalidCodeUnits::Yes)), utf8_string); diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index 1cc8ec34f79..898ac7a9832 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -395,7 +395,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_fullscreen(!window->is_fullscreen()); })); - auto& rotation_axis_menu = view_menu.add_submenu(TRY("Rotation &Axis"_string)); + auto& rotation_axis_menu = view_menu.add_submenu("Rotation &Axis"_string); auto rotation_x_action = GUI::Action::create_checkable("&X", [&widget](auto&) { widget->toggle_rotate_x(); }); @@ -413,7 +413,7 @@ ErrorOr serenity_main(Main::Arguments arguments) rotation_x_action->set_checked(true); rotation_z_action->set_checked(true); - auto& rotation_speed_menu = view_menu.add_submenu(TRY("Rotation &Speed"_string)); + auto& rotation_speed_menu = view_menu.add_submenu("Rotation &Speed"_string); GUI::ActionGroup rotation_speed_actions; rotation_speed_actions.set_exclusive(true); @@ -448,7 +448,7 @@ ErrorOr serenity_main(Main::Arguments arguments) view_menu.add_action(*show_frame_rate_action); - auto& texture_menu = window->add_menu(TRY("&Texture"_string)); + auto& texture_menu = window->add_menu("&Texture"_string); auto texture_enabled_action = GUI::Action::create_checkable("&Enable Texture", [&widget](auto& action) { widget->set_texture_enabled(action.is_checked()); @@ -542,7 +542,7 @@ ErrorOr serenity_main(Main::Arguments arguments) texture_scale_1_action->set_checked(true); - auto& texture_mag_filter_menu = texture_menu.add_submenu(TRY("Mag Filter"_string)); + auto& texture_mag_filter_menu = texture_menu.add_submenu("Mag Filter"_string); GUI::ActionGroup texture_mag_filter_actions; texture_mag_filter_actions.set_exclusive(true); diff --git a/Userland/Applications/About/main.cpp b/Userland/Applications/About/main.cpp index 72805f84b7b..a44900f1e29 100644 --- a/Userland/Applications/About/main.cpp +++ b/Userland/Applications/About/main.cpp @@ -21,6 +21,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil(nullptr, nullptr)); auto app_icon = TRY(GUI::Icon::try_create_default_icon("ladyball"sv)); - TRY(GUI::AboutDialog::show(TRY("SerenityOS"_string), TRY(Core::Version::read_long_version_string()), app_icon.bitmap_for_size(32), nullptr, app_icon.bitmap_for_size(16))); + TRY(GUI::AboutDialog::show("SerenityOS"_string, TRY(Core::Version::read_long_version_string()), app_icon.bitmap_for_size(32), nullptr, app_icon.bitmap_for_size(16))); return app->exec(); } diff --git a/Userland/Applications/Browser/BookmarksBarWidget.cpp b/Userland/Applications/Browser/BookmarksBarWidget.cpp index ec38aa44a20..048c617eef3 100644 --- a/Userland/Applications/Browser/BookmarksBarWidget.cpp +++ b/Userland/Applications/Browser/BookmarksBarWidget.cpp @@ -265,7 +265,7 @@ void BookmarksBarWidget::update_content_size() } else { // hide all items > m_last_visible_index and create new bookmarks menu for them m_additional->set_visible(true); - m_additional_menu = GUI::Menu::construct("Additional Bookmarks"_string.release_value_but_fixme_should_propagate_errors()); + m_additional_menu = GUI::Menu::construct("Additional Bookmarks"_string); m_additional->set_menu(m_additional_menu); for (size_t i = m_last_visible_index; i < m_bookmarks.size(); ++i) { auto& bookmark = m_bookmarks.at(i); diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp index aee603ec2dd..1074ae5d130 100644 --- a/Userland/Applications/Browser/BrowserWindow.cpp +++ b/Userland/Applications/Browser/BrowserWindow.cpp @@ -215,9 +215,9 @@ void BrowserWindow::build_menus() m_go_back_action = GUI::CommonActions::make_go_back_action([this](auto&) { active_tab().go_back(); }, this); m_go_forward_action = GUI::CommonActions::make_go_forward_action([this](auto&) { active_tab().go_forward(); }, this); m_go_home_action = GUI::CommonActions::make_go_home_action([this](auto&) { active_tab().load(Browser::url_from_user_input(g_home_url)); }, this); - m_go_home_action->set_status_tip("Go to home page"_string.release_value_but_fixme_should_propagate_errors()); + m_go_home_action->set_status_tip("Go to home page"_string); m_reload_action = GUI::CommonActions::make_reload_action([this](auto&) { active_tab().reload(); }, this); - m_reload_action->set_status_tip("Reload current page"_string.release_value_but_fixme_should_propagate_errors()); + m_reload_action->set_status_tip("Reload current page"_string); auto& go_menu = add_menu("&Go"_short_string); go_menu.add_action(*m_go_back_action); @@ -242,23 +242,23 @@ void BrowserWindow::build_menus() active_tab().view().get_source(); }, this); - m_view_source_action->set_status_tip("View source code of the current page"_string.release_value_but_fixme_should_propagate_errors()); + m_view_source_action->set_status_tip("View source code of the current page"_string); m_inspect_dom_tree_action = GUI::Action::create( "Inspect &DOM Tree", { Mod_None, Key_F12 }, g_icon_bag.dom_tree, [this](auto&) { active_tab().show_inspector_window(Tab::InspectorTarget::Document); }, this); - m_inspect_dom_tree_action->set_status_tip("Open inspector window for this page"_string.release_value_but_fixme_should_propagate_errors()); + m_inspect_dom_tree_action->set_status_tip("Open inspector window for this page"_string); m_inspect_dom_node_action = GUI::Action::create( "&Inspect Element", g_icon_bag.inspect, [this](auto&) { active_tab().show_inspector_window(Tab::InspectorTarget::HoveredElement); }, this); - m_inspect_dom_node_action->set_status_tip("Open inspector for this element"_string.release_value_but_fixme_should_propagate_errors()); + m_inspect_dom_node_action->set_status_tip("Open inspector for this element"_string); - auto& inspect_menu = add_menu("&Inspect"_string.release_value_but_fixme_should_propagate_errors()); + auto& inspect_menu = add_menu("&Inspect"_string); inspect_menu.add_action(*m_view_source_action); inspect_menu.add_action(*m_inspect_dom_tree_action); @@ -267,7 +267,7 @@ void BrowserWindow::build_menus() active_tab().show_console_window(); }, this); - js_console_action->set_status_tip("Open JavaScript console for this page"_string.release_value_but_fixme_should_propagate_errors()); + js_console_action->set_status_tip("Open JavaScript console for this page"_string); inspect_menu.add_action(js_console_action); auto storage_window_action = GUI::Action::create( @@ -275,7 +275,7 @@ void BrowserWindow::build_menus() active_tab().show_storage_inspector(); }, this); - storage_window_action->set_status_tip("Show Storage inspector for this page"_string.release_value_but_fixme_should_propagate_errors()); + storage_window_action->set_status_tip("Show Storage inspector for this page"_string); inspect_menu.add_action(storage_window_action); auto history_window_action = GUI::Action::create( @@ -283,10 +283,10 @@ void BrowserWindow::build_menus() active_tab().show_history_inspector(); }, this); - storage_window_action->set_status_tip("Show History inspector for this tab"_string.release_value_but_fixme_should_propagate_errors()); + storage_window_action->set_status_tip("Show History inspector for this tab"_string); inspect_menu.add_action(history_window_action); - auto& settings_menu = add_menu("&Settings"_string.release_value_but_fixme_should_propagate_errors()); + auto& settings_menu = add_menu("&Settings"_string); m_change_homepage_action = GUI::Action::create( "Set Homepage URL...", g_icon_bag.go_home, [this](auto&) { @@ -309,7 +309,7 @@ void BrowserWindow::build_menus() dbgln("Failed to open search-engines file: {}", load_search_engines_result.error()); } - auto& color_scheme_menu = settings_menu.add_submenu("&Color Scheme"_string.release_value_but_fixme_should_propagate_errors()); + auto& color_scheme_menu = settings_menu.add_submenu("&Color Scheme"_string); color_scheme_menu.set_icon(g_icon_bag.color_chooser); { auto current_setting = Web::CSS::preferred_color_scheme_from_string(Config::read_string("Browser"sv, "Preferences"sv, "ColorScheme"sv, Browser::default_color_scheme)); @@ -400,7 +400,7 @@ void BrowserWindow::build_menus() })); m_user_agent_spoof_actions.set_exclusive(true); - auto& spoof_user_agent_menu = debug_menu.add_submenu("Spoof &User Agent"_string.release_value_but_fixme_should_propagate_errors()); + auto& spoof_user_agent_menu = debug_menu.add_submenu("Spoof &User Agent"_string); m_disable_user_agent_spoofing = GUI::Action::create_checkable("Disabled", [this](auto&) { active_tab().view().debug_request("spoof-user-agent", Web::default_user_agent); }); @@ -470,7 +470,7 @@ void BrowserWindow::build_menus() ErrorOr BrowserWindow::load_search_engines(GUI::Menu& settings_menu) { m_search_engine_actions.set_exclusive(true); - auto& search_engine_menu = settings_menu.add_submenu("&Search Engine"_string.release_value_but_fixme_should_propagate_errors()); + auto& search_engine_menu = settings_menu.add_submenu("&Search Engine"_string); search_engine_menu.set_icon(g_icon_bag.find); bool search_engine_set = false; diff --git a/Userland/Applications/Browser/CookiesModel.cpp b/Userland/Applications/Browser/CookiesModel.cpp index 2dfabc6b948..2ee6ed74327 100644 --- a/Userland/Applications/Browser/CookiesModel.cpp +++ b/Userland/Applications/Browser/CookiesModel.cpp @@ -46,9 +46,9 @@ ErrorOr CookiesModel::column_name(int column) const case Column::Value: return "Value"_short_string; case Column::ExpiryTime: - return TRY("Expiry time"_string); + return "Expiry time"_string; case Column::SameSite: - return TRY("SameSite"_string); + return "SameSite"_string; case Column::__Count: return String {}; } diff --git a/Userland/Applications/Browser/DownloadWidget.cpp b/Userland/Applications/Browser/DownloadWidget.cpp index 9d65433e1fa..59117674fd7 100644 --- a/Userland/Applications/Browser/DownloadWidget.cpp +++ b/Userland/Applications/Browser/DownloadWidget.cpp @@ -93,7 +93,7 @@ DownloadWidget::DownloadWidget(const URL& url) destination_label.set_fixed_height(16); destination_label.set_text_wrapping(Gfx::TextWrapping::DontWrap); - m_close_on_finish_checkbox = add("Close when finished"_string.release_value_but_fixme_should_propagate_errors()); + m_close_on_finish_checkbox = add("Close when finished"_string); m_close_on_finish_checkbox->set_checked(close_on_finish); m_close_on_finish_checkbox->on_checked = [&](bool checked) { @@ -156,7 +156,7 @@ void DownloadWidget::did_finish(bool success) m_browser_image->load_from_file("/res/graphics/download-finished.gif"sv); window()->set_title("Download finished!"); m_close_button->set_enabled(true); - m_cancel_button->set_text("Open in Folder"_string.release_value_but_fixme_should_propagate_errors()); + m_cancel_button->set_text("Open in Folder"_string); m_cancel_button->on_click = [this](auto) { Desktop::Launcher::open(URL::create_with_file_scheme(Core::StandardPaths::downloads_directory(), m_url.basename())); window()->close(); diff --git a/Userland/Applications/Browser/InspectorWidget.cpp b/Userland/Applications/Browser/InspectorWidget.cpp index 756418a8481..639a91c1326 100644 --- a/Userland/Applications/Browser/InspectorWidget.cpp +++ b/Userland/Applications/Browser/InspectorWidget.cpp @@ -92,7 +92,7 @@ InspectorWidget::InspectorWidget() set_selection(index); }; - auto& accessibility_tree_container = top_tab_widget.add_tab("Accessibility"_string.release_value_but_fixme_should_propagate_errors()); + auto& accessibility_tree_container = top_tab_widget.add_tab("Accessibility"_string); accessibility_tree_container.set_layout(4); m_accessibility_tree_view = accessibility_tree_container.add(); m_accessibility_tree_view->on_selection_change = [this] { @@ -102,24 +102,24 @@ InspectorWidget::InspectorWidget() auto& bottom_tab_widget = splitter.add(); - auto& computed_style_table_container = bottom_tab_widget.add_tab("Computed"_string.release_value_but_fixme_should_propagate_errors()); + auto& computed_style_table_container = bottom_tab_widget.add_tab("Computed"_string); computed_style_table_container.set_layout(4); m_computed_style_table_view = computed_style_table_container.add(); - auto& resolved_style_table_container = bottom_tab_widget.add_tab("Resolved"_string.release_value_but_fixme_should_propagate_errors()); + auto& resolved_style_table_container = bottom_tab_widget.add_tab("Resolved"_string); resolved_style_table_container.set_layout(4); m_resolved_style_table_view = resolved_style_table_container.add(); - auto& custom_properties_table_container = bottom_tab_widget.add_tab("Variables"_string.release_value_but_fixme_should_propagate_errors()); + auto& custom_properties_table_container = bottom_tab_widget.add_tab("Variables"_string); custom_properties_table_container.set_layout(4); m_custom_properties_table_view = custom_properties_table_container.add(); - auto& box_model_widget = bottom_tab_widget.add_tab("Box Model"_string.release_value_but_fixme_should_propagate_errors()); + auto& box_model_widget = bottom_tab_widget.add_tab("Box Model"_string); box_model_widget.set_layout(4); m_element_size_view = box_model_widget.add(); m_element_size_view->set_should_hide_unnecessary_scrollbars(true); - auto& aria_properties_state_widget = bottom_tab_widget.add_tab("ARIA"_string.release_value_but_fixme_should_propagate_errors()); + auto& aria_properties_state_widget = bottom_tab_widget.add_tab("ARIA"_string); aria_properties_state_widget.set_layout(4); m_aria_properties_state_view = aria_properties_state_widget.add(); diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 9598ca969c5..3b530793e78 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -602,7 +602,7 @@ Tab::Tab(BrowserWindow& window, WebView::UseJavaScriptBytecode use_javascript_by } }, this); - take_visible_screenshot_action->set_status_tip("Save a screenshot of the visible portion of the current tab to the Downloads directory"_string.release_value_but_fixme_should_propagate_errors()); + take_visible_screenshot_action->set_status_tip("Save a screenshot of the visible portion of the current tab to the Downloads directory"_string); auto take_full_screenshot_action = GUI::Action::create( "Take &Full Screenshot"sv, g_icon_bag.filetype_image, [this](auto&) { @@ -612,7 +612,7 @@ Tab::Tab(BrowserWindow& window, WebView::UseJavaScriptBytecode use_javascript_by } }, this); - take_full_screenshot_action->set_status_tip("Save a screenshot of the entirety of the current tab to the Downloads directory"_string.release_value_but_fixme_should_propagate_errors()); + take_full_screenshot_action->set_status_tip("Save a screenshot of the entirety of the current tab to the Downloads directory"_string); m_page_context_menu = GUI::Menu::construct(); m_page_context_menu->add_action(window.go_back_action()); diff --git a/Userland/Applications/Browser/WindowActions.cpp b/Userland/Applications/Browser/WindowActions.cpp index 6e5bba74345..3a1ae4fb384 100644 --- a/Userland/Applications/Browser/WindowActions.cpp +++ b/Userland/Applications/Browser/WindowActions.cpp @@ -31,7 +31,7 @@ WindowActions::WindowActions(GUI::Window& window) on_create_new_tab(); }, &window); - m_create_new_tab_action->set_status_tip("Open a new tab"_string.release_value_but_fixme_should_propagate_errors()); + m_create_new_tab_action->set_status_tip("Open a new tab"_string); m_create_new_window_action = GUI::Action::create( "&New Window", { Mod_Ctrl, Key_N }, g_icon_bag.new_window, [this](auto&) { @@ -40,7 +40,7 @@ WindowActions::WindowActions(GUI::Window& window) } }, &window); - m_create_new_window_action->set_status_tip("Open a new browser window"_string.release_value_but_fixme_should_propagate_errors()); + m_create_new_window_action->set_status_tip("Open a new browser window"_string); m_next_tab_action = GUI::Action::create( "&Next Tab", { Mod_Ctrl, Key_PageDown }, [this](auto&) { @@ -48,7 +48,7 @@ WindowActions::WindowActions(GUI::Window& window) on_next_tab(); }, &window); - m_next_tab_action->set_status_tip("Switch to the next tab"_string.release_value_but_fixme_should_propagate_errors()); + m_next_tab_action->set_status_tip("Switch to the next tab"_string); m_previous_tab_action = GUI::Action::create( "&Previous Tab", { Mod_Ctrl, Key_PageUp }, [this](auto&) { @@ -56,7 +56,7 @@ WindowActions::WindowActions(GUI::Window& window) on_previous_tab(); }, &window); - m_previous_tab_action->set_status_tip("Switch to the previous tab"_string.release_value_but_fixme_should_propagate_errors()); + m_previous_tab_action->set_status_tip("Switch to the previous tab"_string); for (auto i = 0; i <= 7; ++i) { m_tab_actions.append(GUI::Action::create( @@ -73,7 +73,7 @@ WindowActions::WindowActions(GUI::Window& window) on_tabs[8](); }, &window)); - m_tab_actions.last()->set_status_tip("Switch to last tab"_string.release_value_but_fixme_should_propagate_errors()); + m_tab_actions.last()->set_status_tip("Switch to last tab"_string); m_about_action = GUI::CommonActions::make_about_action("Ladybird", GUI::Icon::default_icon("app-browser"sv), &window); @@ -84,7 +84,7 @@ WindowActions::WindowActions(GUI::Window& window) on_show_bookmarks_bar(action); }, &window); - m_show_bookmarks_bar_action->set_status_tip("Show/hide the bookmarks bar"_string.release_value_but_fixme_should_propagate_errors()); + m_show_bookmarks_bar_action->set_status_tip("Show/hide the bookmarks bar"_string); m_vertical_tabs_action = GUI::Action::create_checkable( "&Vertical Tabs", { Mod_Ctrl, Key_Comma }, @@ -93,7 +93,7 @@ WindowActions::WindowActions(GUI::Window& window) on_vertical_tabs(action); }, &window); - m_vertical_tabs_action->set_status_tip("Enable/Disable vertical tabs"_string.release_value_but_fixme_should_propagate_errors()); + m_vertical_tabs_action->set_status_tip("Enable/Disable vertical tabs"_string); } } diff --git a/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp b/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp index dd9e6508dd8..651395d7909 100644 --- a/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp +++ b/Userland/Applications/BrowserSettings/BrowserSettingsWidget.cpp @@ -98,7 +98,7 @@ ErrorOr BrowserSettingsWidget::setup() Vector search_engine_fields; search_engine_fields.empend("title", "Title"_short_string, Gfx::TextAlignment::CenterLeft); - search_engine_fields.empend("url_format", TRY("Url format"_string), Gfx::TextAlignment::CenterLeft); + search_engine_fields.empend("url_format", "Url format"_string, Gfx::TextAlignment::CenterLeft); auto search_engines_model = GUI::JsonArrayModel::create(DeprecatedString::formatted("{}/SearchEngines.json", Core::StandardPaths::config_directory()), move(search_engine_fields)); search_engines_model->invalidate(); Vector custom_search_engine; diff --git a/Userland/Applications/BrowserSettings/main.cpp b/Userland/Applications/BrowserSettings/main.cpp index f354e8b40ea..a8784a35052 100644 --- a/Userland/Applications/BrowserSettings/main.cpp +++ b/Userland/Applications/BrowserSettings/main.cpp @@ -38,8 +38,8 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); (void)TRY(window->add_tab(TRY(BrowserSettingsWidget::create()), "Browser"_short_string, "browser"sv)); - (void)TRY(window->add_tab(TRY(ContentFilterSettingsWidget::create()), TRY("Content Filtering"_string), "content-filtering"sv)); - (void)TRY(window->add_tab(TRY(AutoplaySettingsWidget::create()), TRY("Autoplay"_string), "autoplay"sv)); + (void)TRY(window->add_tab(TRY(ContentFilterSettingsWidget::create()), "Content Filtering"_string, "content-filtering"sv)); + (void)TRY(window->add_tab(TRY(AutoplaySettingsWidget::create()), "Autoplay"_string, "autoplay"sv)); window->set_active_tab(selected_tab); window->show(); diff --git a/Userland/Applications/Calculator/main.cpp b/Userland/Applications/Calculator/main.cpp index 9ab86c5cf23..a691e04b722 100644 --- a/Userland/Applications/Calculator/main.cpp +++ b/Userland/Applications/Calculator/main.cpp @@ -58,7 +58,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } })); - auto& constants_menu = window->add_menu(TRY("&Constants"_string)); + auto& constants_menu = window->add_menu("&Constants"_string); auto const power = Crypto::NumberTheory::Power("10"_bigint, "10"_bigint); constants_menu.add_action(GUI::Action::create("&Pi", TRY(Gfx::Bitmap::load_from_file("/res/icons/calculator/pi.png"sv)), [&](auto&) { diff --git a/Userland/Applications/Calendar/AddEventDialog.cpp b/Userland/Applications/Calendar/AddEventDialog.cpp index 80f9e8e2dcb..299093a2e0c 100644 --- a/Userland/Applications/Calendar/AddEventDialog.cpp +++ b/Userland/Applications/Calendar/AddEventDialog.cpp @@ -36,7 +36,7 @@ AddEventDialog::AddEventDialog(Core::DateTime date_time, Window* parent_window) top_container.set_layout(4); top_container.set_fixed_height(45); - auto& add_label = top_container.add("Add title & date:"_string.release_value_but_fixme_should_propagate_errors()); + auto& add_label = top_container.add("Add title & date:"_string); add_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); add_label.set_fixed_height(14); add_label.set_font(Gfx::FontDatabase::default_font().bold_variant()); @@ -134,7 +134,7 @@ ErrorOr AddEventDialog::MeridiemListModel::column_name(int column) const { switch (column) { case Column::Meridiem: - return TRY("Meridiem"_string); + return "Meridiem"_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/CalendarSettings/main.cpp b/Userland/Applications/CalendarSettings/main.cpp index 952c4d1475a..25f912d097e 100644 --- a/Userland/Applications/CalendarSettings/main.cpp +++ b/Userland/Applications/CalendarSettings/main.cpp @@ -33,7 +33,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app_icon = GUI::Icon::default_icon("app-calendar"sv); auto window = TRY(GUI::SettingsWindow::create("Calendar Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes)); - (void)TRY(window->add_tab(TRY("Calendar"_string), "Calendar"sv)); + (void)TRY(window->add_tab("Calendar"_string, "Calendar"sv)); window->set_icon(app_icon.bitmap_for_size(16)); window->set_active_tab(selected_tab); diff --git a/Userland/Applications/CertificateSettings/CertificateStoreWidget.cpp b/Userland/Applications/CertificateSettings/CertificateStoreWidget.cpp index 6d0cf87798a..c56b4c300f4 100644 --- a/Userland/Applications/CertificateSettings/CertificateStoreWidget.cpp +++ b/Userland/Applications/CertificateSettings/CertificateStoreWidget.cpp @@ -38,11 +38,11 @@ ErrorOr CertificateStoreModel::column_name(int column) const { switch (column) { case Column::IssuedTo: - return TRY("Issued To"_string); + return "Issued To"_string; case Column::IssuedBy: - return TRY("Issued By"_string); + return "Issued By"_string; case Column::Expire: - return TRY("Expiration Date"_string); + return "Expiration Date"_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/CertificateSettings/main.cpp b/Userland/Applications/CertificateSettings/main.cpp index 8eb549cb045..9b1116f1ef3 100644 --- a/Userland/Applications/CertificateSettings/main.cpp +++ b/Userland/Applications/CertificateSettings/main.cpp @@ -28,7 +28,7 @@ ErrorOr serenity_main(Main::Arguments args) auto app_icon = GUI::Icon::default_icon("certificate"sv); auto window = TRY(GUI::SettingsWindow::create("Certificate Settings", GUI::SettingsWindow::ShowDefaultsButton::No)); - auto cert_store_widget = TRY(window->add_tab(TRY("Certificate Store"_string), "certificate"sv)); + auto cert_store_widget = TRY(window->add_tab("Certificate Store"_string, "certificate"sv)); window->set_icon(app_icon.bitmap_for_size(16)); window->show(); diff --git a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp index 590dd698312..225b6e78c2a 100644 --- a/Userland/Applications/CharacterMap/CharacterMapWidget.cpp +++ b/Userland/Applications/CharacterMap/CharacterMapWidget.cpp @@ -56,17 +56,17 @@ CharacterMapWidget::CharacterMapWidget() } GUI::Clipboard::the().set_plain_text(builder.to_deprecated_string()); }); - m_copy_selection_action->set_status_tip("Copy the highlighted characters to the clipboard"_string.release_value_but_fixme_should_propagate_errors()); + m_copy_selection_action->set_status_tip("Copy the highlighted characters to the clipboard"_string); m_previous_glyph_action = GUI::Action::create("&Previous Glyph", { Mod_Alt, Key_Left }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) { m_glyph_map->select_previous_existing_glyph(); }); - m_previous_glyph_action->set_status_tip("Seek the previous visible glyph"_string.release_value_but_fixme_should_propagate_errors()); + m_previous_glyph_action->set_status_tip("Seek the previous visible glyph"_string); m_next_glyph_action = GUI::Action::create("&Next Glyph", { Mod_Alt, Key_Right }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) { m_glyph_map->select_next_existing_glyph(); }); - m_next_glyph_action->set_status_tip("Seek the next visible glyph"_string.release_value_but_fixme_should_propagate_errors()); + m_next_glyph_action->set_status_tip("Seek the next visible glyph"_string); m_go_to_glyph_action = GUI::Action::create("&Go to Glyph...", { Mod_Ctrl, Key_G }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) { String input; @@ -81,7 +81,7 @@ CharacterMapWidget::CharacterMapWidget() m_glyph_map->scroll_to_glyph(code_point); } }); - m_go_to_glyph_action->set_status_tip("Go to the specified code point"_string.release_value_but_fixme_should_propagate_errors()); + m_go_to_glyph_action->set_status_tip("Go to the specified code point"_string); m_find_glyphs_action = GUI::Action::create("&Find Glyphs...", { Mod_Ctrl, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) { if (m_find_window.is_null()) { diff --git a/Userland/Applications/ClockSettings/main.cpp b/Userland/Applications/ClockSettings/main.cpp index c5a44b2f4c5..0ba0eb718eb 100644 --- a/Userland/Applications/ClockSettings/main.cpp +++ b/Userland/Applications/ClockSettings/main.cpp @@ -38,7 +38,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = TRY(GUI::SettingsWindow::create("Clock Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes)); (void)TRY(window->add_tab("Clock"_short_string, "clock"sv)); auto timezonesettings_widget = TRY(TimeZoneSettingsWidget::create()); - TRY(window->add_tab(timezonesettings_widget, TRY("Time Zone"_string), "time-zone"sv)); + TRY(window->add_tab(timezonesettings_widget, "Time Zone"_string, "time-zone"sv)); window->set_icon(app_icon.bitmap_for_size(16)); window->resize(540, 570); diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp index 4d2b3e8641d..4877329c846 100644 --- a/Userland/Applications/CrashReporter/main.cpp +++ b/Userland/Applications/CrashReporter/main.cpp @@ -236,27 +236,27 @@ ErrorOr serenity_main(Main::Arguments arguments) auto& progressbar = *widget->find_descendant_of_type_named("progressbar"); auto& tab_widget = *widget->find_descendant_of_type_named("tab_widget"); - auto backtrace_tab = TRY(tab_widget.try_add_tab(TRY("Backtrace"_string))); + auto backtrace_tab = TRY(tab_widget.try_add_tab("Backtrace"_string)); TRY(backtrace_tab->try_set_layout(4)); - auto backtrace_label = TRY(backtrace_tab->try_add(TRY("A backtrace for each thread alive during the crash is listed below:"_string))); + auto backtrace_label = TRY(backtrace_tab->try_add("A backtrace for each thread alive during the crash is listed below:"_string)); backtrace_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); backtrace_label->set_fixed_height(16); auto backtrace_tab_widget = TRY(backtrace_tab->try_add()); backtrace_tab_widget->set_tab_position(GUI::TabWidget::TabPosition::Bottom); - auto cpu_registers_tab = TRY(tab_widget.try_add_tab(TRY("CPU Registers"_string))); + auto cpu_registers_tab = TRY(tab_widget.try_add_tab("CPU Registers"_string)); cpu_registers_tab->set_layout(4); - auto cpu_registers_label = TRY(cpu_registers_tab->try_add(TRY("The CPU register state for each thread alive during the crash is listed below:"_string))); + auto cpu_registers_label = TRY(cpu_registers_tab->try_add("The CPU register state for each thread alive during the crash is listed below:"_string)); cpu_registers_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); cpu_registers_label->set_fixed_height(16); auto cpu_registers_tab_widget = TRY(cpu_registers_tab->try_add()); cpu_registers_tab_widget->set_tab_position(GUI::TabWidget::TabPosition::Bottom); - auto environment_tab = TRY(tab_widget.try_add_tab(TRY("Environment"_string))); + auto environment_tab = TRY(tab_widget.try_add_tab("Environment"_string)); TRY(environment_tab->try_set_layout(4)); auto environment_text_editor = TRY(environment_tab->try_add()); @@ -265,7 +265,7 @@ ErrorOr serenity_main(Main::Arguments arguments) environment_text_editor->set_wrapping_mode(GUI::TextEditor::WrappingMode::NoWrap); environment_text_editor->set_should_hide_unnecessary_scrollbars(true); - auto memory_regions_tab = TRY(tab_widget.try_add_tab(TRY("Memory Regions"_string))); + auto memory_regions_tab = TRY(tab_widget.try_add_tab("Memory Regions"_string)); TRY(memory_regions_tab->try_set_layout(4)); auto memory_regions_text_editor = TRY(memory_regions_tab->try_add()); diff --git a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp index 6a5b4b065cb..4530fd65c43 100644 --- a/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp +++ b/Userland/Applications/DisplaySettings/DesktopSettingsWidget.cpp @@ -37,7 +37,7 @@ ErrorOr DesktopSettingsWidget::create_frame() }; auto& keyboard_shortcuts_label = *find_descendant_of_type_named("keyboard_shortcuts_label"); - keyboard_shortcuts_label.set_text(TRY("\xE2\x84\xB9\tCtrl+Alt+{Shift}+Arrows moves between workspaces"_string)); + keyboard_shortcuts_label.set_text("\xE2\x84\xB9\tCtrl+Alt+{Shift}+Arrows moves between workspaces"_string); return {}; } diff --git a/Userland/Applications/DisplaySettings/main.cpp b/Userland/Applications/DisplaySettings/main.cpp index 5d530c937f1..fe8285fd926 100644 --- a/Userland/Applications/DisplaySettings/main.cpp +++ b/Userland/Applications/DisplaySettings/main.cpp @@ -37,11 +37,11 @@ ErrorOr serenity_main(Main::Arguments arguments) bool background_settings_changed = false; auto window = TRY(GUI::SettingsWindow::create("Display Settings")); - (void)TRY(window->add_tab(TRY("Background"_string), "background"sv, background_settings_changed)); + (void)TRY(window->add_tab("Background"_string, "background"sv, background_settings_changed)); (void)TRY(window->add_tab("Themes"_short_string, "themes"sv, background_settings_changed)); (void)TRY(window->add_tab("Fonts"_short_string, "fonts"sv)); (void)TRY(window->add_tab("Monitor"_short_string, "monitor"sv)); - (void)TRY(window->add_tab(TRY("Workspaces"_string), "workspaces"sv)); + (void)TRY(window->add_tab("Workspaces"_string, "workspaces"sv)); (void)TRY(window->add_tab("Effects"_short_string, "effects"sv)); window->set_active_tab(selected_tab); diff --git a/Userland/Applications/FileManager/FileOperationProgressWidget.cpp b/Userland/Applications/FileManager/FileOperationProgressWidget.cpp index 0f9a71a7ecb..100b8e76ffe 100644 --- a/Userland/Applications/FileManager/FileOperationProgressWidget.cpp +++ b/Userland/Applications/FileManager/FileOperationProgressWidget.cpp @@ -54,16 +54,16 @@ FileOperationProgressWidget::FileOperationProgressWidget(FileOperation operation switch (m_operation) { case FileOperation::Copy: - files_copied_label.set_text("Copying files..."_string.release_value_but_fixme_should_propagate_errors()); - current_file_action_label.set_text("Copying: "_string.release_value_but_fixme_should_propagate_errors()); + files_copied_label.set_text("Copying files..."_string); + current_file_action_label.set_text("Copying: "_string); break; case FileOperation::Move: - files_copied_label.set_text("Moving files..."_string.release_value_but_fixme_should_propagate_errors()); - current_file_action_label.set_text("Moving: "_string.release_value_but_fixme_should_propagate_errors()); + files_copied_label.set_text("Moving files..."_string); + current_file_action_label.set_text("Moving: "_string); break; case FileOperation::Delete: - files_copied_label.set_text("Deleting files..."_string.release_value_but_fixme_should_propagate_errors()); - current_file_action_label.set_text("Deleting: "_string.release_value_but_fixme_should_propagate_errors()); + files_copied_label.set_text("Deleting files..."_string); + current_file_action_label.set_text("Deleting: "_string); break; default: VERIFY_NOT_REACHED(); diff --git a/Userland/Applications/FileManager/PropertiesWindow.cpp b/Userland/Applications/FileManager/PropertiesWindow.cpp index e62d306c794..02cca21c19e 100644 --- a/Userland/Applications/FileManager/PropertiesWindow.cpp +++ b/Userland/Applications/FileManager/PropertiesWindow.cpp @@ -182,7 +182,7 @@ ErrorOr PropertiesWindow::create_general_tab(GUI::TabWidget& tab_widget, b m_size_label = general_tab->find_descendant_of_type_named("size"); m_size_label->set_text(S_ISDIR(st.st_mode) - ? TRY("Calculating..."_string) + ? "Calculating..."_string : TRY(String::from_deprecated_string(human_readable_size_long(st.st_size, UseThousandsSeparator::Yes)))); auto* owner = general_tab->find_descendant_of_type_named("owner"); @@ -255,7 +255,7 @@ ErrorOr PropertiesWindow::create_archive_tab(GUI::TabWidget& tab_widget, N } auto zip = maybe_zip.release_value(); - auto tab = TRY(tab_widget.try_add_tab(TRY("Archive"_string))); + auto tab = TRY(tab_widget.try_add_tab("Archive"_string)); TRY(tab->load_from_gml(properties_window_archive_tab_gml)); auto statistics = TRY(zip.calculate_statistics()); @@ -365,19 +365,19 @@ ErrorOr PropertiesWindow::create_font_tab(GUI::TabWidget& tab_widget, Nonn String format_name; switch (font_info.format) { case FontInfo::Format::BitmapFont: - format_name = TRY("Bitmap Font"_string); + format_name = "Bitmap Font"_string; break; case FontInfo::Format::OpenType: - format_name = TRY("OpenType"_string); + format_name = "OpenType"_string; break; case FontInfo::Format::TrueType: - format_name = TRY("TrueType"_string); + format_name = "TrueType"_string; break; case FontInfo::Format::WOFF: - format_name = TRY("WOFF"_string); + format_name = "WOFF"_string; break; case FontInfo::Format::WOFF2: - format_name = TRY("WOFF2"_string); + format_name = "WOFF2"_string; break; } tab->find_descendant_of_type_named("font_format")->set_text(format_name); @@ -438,11 +438,11 @@ ErrorOr PropertiesWindow::create_image_tab(GUI::TabWidget& tab_widget, Non if (auto embedded_icc_bytes = TRY(image_decoder->icc_data()); embedded_icc_bytes.has_value()) { auto icc_profile_or_error = Gfx::ICC::Profile::try_load_from_externally_owned_memory(embedded_icc_bytes.value()); if (icc_profile_or_error.is_error()) { - hide_icc_group(TRY("Present but invalid"_string)); + hide_icc_group("Present but invalid"_string); } else { auto icc_profile = icc_profile_or_error.release_value(); - tab->find_descendant_of_type_named("image_has_icc_profile")->set_text(TRY("See below"_string)); + tab->find_descendant_of_type_named("image_has_icc_profile")->set_text("See below"_string); tab->find_descendant_of_type_named("image_icc_profile")->set_text(icc_profile->tag_string_data(Gfx::ICC::profileDescriptionTag).value_or({})); tab->find_descendant_of_type_named("image_icc_copyright")->set_text(icc_profile->tag_string_data(Gfx::ICC::copyrightTag).value_or({})); tab->find_descendant_of_type_named("image_icc_color_space")->set_text(TRY(String::from_utf8(data_color_space_name(icc_profile->data_color_space())))); @@ -468,7 +468,7 @@ ErrorOr PropertiesWindow::create_pdf_tab(GUI::TabWidget& tab_widget, Nonnu if (auto handler = document->security_handler(); handler && !handler->has_user_password()) { // FIXME: Show a password dialog, once we've switched to lazy-loading auto tab = TRY(tab_widget.try_add_tab("PDF"_short_string)); - tab->set_text(TRY("PDF is password-protected."_string)); + tab->set_text("PDF is password-protected."_string); return {}; } diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp index 8913462c8e0..5b08a493647 100644 --- a/Userland/Applications/FileManager/main.cpp +++ b/Userland/Applications/FileManager/main.cpp @@ -362,7 +362,7 @@ bool add_launch_handler_actions_to_menu(RefPtr& menu, DirectoryView c if (current_file_launch_handlers.size() > 1) { added_open_menu_items = true; - auto& file_open_with_menu = menu->add_submenu("Open with"_string.release_value_but_fixme_should_propagate_errors()); + auto& file_open_with_menu = menu->add_submenu("Open with"_string); for (auto& handler : current_file_launch_handlers) { if (handler == default_file_handler) continue; @@ -476,7 +476,7 @@ ErrorOr run_in_desktop_mode() paste_action->set_enabled(data_type == "text/uri-list" && access(directory_view->path().characters(), W_OK) == 0); }; - auto desktop_view_context_menu = TRY(GUI::Menu::try_create(TRY("Directory View"_string))); + auto desktop_view_context_menu = TRY(GUI::Menu::try_create("Directory View"_string)); auto file_manager_action = GUI::Action::create("Open in File &Manager", {}, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-file-manager.png"sv)), [&](auto&) { auto paths = directory_view->selected_file_paths(); @@ -518,7 +518,7 @@ ErrorOr run_in_desktop_mode() TRY(desktop_view_context_menu->try_add_separator()); TRY(desktop_view_context_menu->try_add_action(display_properties_action)); - auto desktop_context_menu = TRY(GUI::Menu::try_create(TRY("Directory View Directory"_string))); + auto desktop_context_menu = TRY(GUI::Menu::try_create("Directory View Directory"_string)); TRY(desktop_context_menu->try_add_action(file_manager_action)); TRY(desktop_context_menu->try_add_action(open_terminal_action)); @@ -541,7 +541,7 @@ ErrorOr run_in_desktop_mode() if (node.is_directory()) { desktop_context_menu->popup(event.screen_position(), file_manager_action); } else { - file_context_menu = GUI::Menu::construct("Directory View File"_string.release_value_but_fixme_should_propagate_errors()); + file_context_menu = GUI::Menu::construct("Directory View File"_string); bool added_open_menu_items = add_launch_handler_actions_to_menu(file_context_menu, directory_view, node.full_path(), file_context_menu_action_default_action, current_file_handlers); if (added_open_menu_items) @@ -685,9 +685,9 @@ ErrorOr run_in_windowed_mode(DeprecatedString const& initial_location, Depr directory_view->refresh(); }; - auto directory_context_menu = TRY(GUI::Menu::try_create(TRY("Directory View Directory"_string))); - auto directory_view_context_menu = TRY(GUI::Menu::try_create(TRY("Directory View"_string))); - auto tree_view_directory_context_menu = TRY(GUI::Menu::try_create(TRY("Tree View Directory"_string))); + auto directory_context_menu = TRY(GUI::Menu::try_create("Directory View Directory"_string)); + auto directory_view_context_menu = TRY(GUI::Menu::try_create("Directory View"_string)); + auto tree_view_directory_context_menu = TRY(GUI::Menu::try_create("Tree View Directory"_string)); auto open_parent_directory_action = GUI::Action::create("Open &Parent Directory", { Mod_Alt, Key_Up }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/open-parent-directory.png"sv)), [&](GUI::Action const&) { directory_view->open_parent_directory(); @@ -1205,7 +1205,7 @@ ErrorOr run_in_windowed_mode(DeprecatedString const& initial_location, Depr folder_specific_paste_action->set_enabled(should_get_enabled); directory_context_menu->popup(event.screen_position(), directory_open_action); } else { - file_context_menu = GUI::Menu::construct("Directory View File"_string.release_value_but_fixme_should_propagate_errors()); + file_context_menu = GUI::Menu::construct("Directory View File"_string); bool added_launch_file_handlers = add_launch_handler_actions_to_menu(file_context_menu, directory_view, node.full_path(), file_context_menu_action_default_action, current_file_handlers); if (added_launch_file_handlers) diff --git a/Userland/Applications/FontEditor/MainWidget.cpp b/Userland/Applications/FontEditor/MainWidget.cpp index 175f8992f70..b3c5ecadd63 100644 --- a/Userland/Applications/FontEditor/MainWidget.cpp +++ b/Userland/Applications/FontEditor/MainWidget.cpp @@ -128,7 +128,7 @@ ErrorOr MainWidget::create_actions() if (auto result = initialize({}, move(maybe_font.value())); result.is_error()) show_error(result.release_error(), "Initializing new font failed"sv); }); - m_new_action->set_status_tip(TRY("Create a new font"_string)); + m_new_action->set_status_tip("Create a new font"_string); m_open_action = GUI::CommonActions::make_open_action([this](auto&) { if (!request_close()) @@ -221,7 +221,7 @@ ErrorOr MainWidget::create_actions() if (m_font_preview_window) m_font_preview_window->show(); }); - m_open_preview_action->set_status_tip(TRY("Preview the current font"_string)); + m_open_preview_action->set_status_tip("Preview the current font"_string); bool show_metadata = Config::read_bool("FontEditor"sv, "Layout"sv, "ShowMetadata"sv, true); m_font_metadata_groupbox->set_visible(show_metadata); @@ -230,7 +230,7 @@ ErrorOr MainWidget::create_actions() Config::write_bool("FontEditor"sv, "Layout"sv, "ShowMetadata"sv, action.is_checked()); }); m_show_metadata_action->set_checked(show_metadata); - m_show_metadata_action->set_status_tip(TRY("Show or hide metadata about the current font"_string)); + m_show_metadata_action->set_status_tip("Show or hide metadata about the current font"_string); bool show_unicode_blocks = Config::read_bool("FontEditor"sv, "Layout"sv, "ShowUnicodeBlocks"sv, true); m_unicode_block_container->set_visible(show_unicode_blocks); @@ -243,7 +243,7 @@ ErrorOr MainWidget::create_actions() Config::write_bool("FontEditor"sv, "Layout"sv, "ShowUnicodeBlocks"sv, action.is_checked()); }); m_show_unicode_blocks_action->set_checked(show_unicode_blocks); - m_show_unicode_blocks_action->set_status_tip(TRY("Show or hide the Unicode block list"_string)); + m_show_unicode_blocks_action->set_status_tip("Show or hide the Unicode block list"_string); bool show_toolbar = Config::read_bool("FontEditor"sv, "Layout"sv, "ShowToolbar"sv, true); m_toolbar_container->set_visible(show_toolbar); @@ -252,7 +252,7 @@ ErrorOr MainWidget::create_actions() Config::write_bool("FontEditor"sv, "Layout"sv, "ShowToolbar"sv, action.is_checked()); }); m_show_toolbar_action->set_checked(show_toolbar); - m_show_toolbar_action->set_status_tip(TRY("Show or hide the toolbar"_string)); + m_show_toolbar_action->set_status_tip("Show or hide the toolbar"_string); bool show_statusbar = Config::read_bool("FontEditor"sv, "Layout"sv, "ShowStatusbar"sv, true); m_statusbar->set_visible(show_statusbar); @@ -262,7 +262,7 @@ ErrorOr MainWidget::create_actions() Config::write_bool("FontEditor"sv, "Layout"sv, "ShowStatusbar"sv, action.is_checked()); }); m_show_statusbar_action->set_checked(show_statusbar); - m_show_statusbar_action->set_status_tip(TRY("Show or hide the status bar"_string)); + m_show_statusbar_action->set_status_tip("Show or hide the status bar"_string); bool highlight_modifications = Config::read_bool("FontEditor"sv, "GlyphMap"sv, "HighlightModifications"sv, true); m_glyph_map_widget->set_highlight_modifications(highlight_modifications); @@ -271,7 +271,7 @@ ErrorOr MainWidget::create_actions() Config::write_bool("FontEditor"sv, "GlyphMap"sv, "HighlightModifications"sv, action.is_checked()); }); m_highlight_modifications_action->set_checked(highlight_modifications); - m_highlight_modifications_action->set_status_tip(TRY("Show or hide highlights on modified glyphs"_string)); + m_highlight_modifications_action->set_status_tip("Show or hide highlights on modified glyphs"_string); bool show_system_emoji = Config::read_bool("FontEditor"sv, "GlyphMap"sv, "ShowSystemEmoji"sv, true); m_glyph_map_widget->set_show_system_emoji(show_system_emoji); @@ -280,7 +280,7 @@ ErrorOr MainWidget::create_actions() Config::write_bool("FontEditor"sv, "GlyphMap"sv, "ShowSystemEmoji"sv, action.is_checked()); }); m_show_system_emoji_action->set_checked(show_system_emoji); - m_show_system_emoji_action->set_status_tip(TRY("Show or hide system emoji"_string)); + m_show_system_emoji_action->set_status_tip("Show or hide system emoji"_string); m_go_to_glyph_action = GUI::Action::create("&Go to Glyph...", { Mod_Ctrl, Key_G }, g_resources.go_to_glyph, [this](auto&) { String input; @@ -296,17 +296,17 @@ ErrorOr MainWidget::create_actions() m_glyph_map_widget->scroll_to_glyph(code_point); } }); - m_go_to_glyph_action->set_status_tip(TRY("Go to the specified code point"_string)); + m_go_to_glyph_action->set_status_tip("Go to the specified code point"_string); m_previous_glyph_action = GUI::Action::create("Pre&vious Glyph", { Mod_Alt, Key_Left }, g_resources.previous_glyph, [this](auto&) { m_glyph_map_widget->select_previous_existing_glyph(); }); - m_previous_glyph_action->set_status_tip(TRY("Seek the previous visible glyph"_string)); + m_previous_glyph_action->set_status_tip("Seek the previous visible glyph"_string); m_next_glyph_action = GUI::Action::create("&Next Glyph", { Mod_Alt, Key_Right }, g_resources.next_glyph, [this](auto&) { m_glyph_map_widget->select_next_existing_glyph(); }); - m_next_glyph_action->set_status_tip(TRY("Seek the next visible glyph"_string)); + m_next_glyph_action->set_status_tip("Seek the next visible glyph"_string); i32 scale = Config::read_i32("FontEditor"sv, "GlyphEditor"sv, "Scale"sv, 10); m_glyph_editor_widget->set_scale(scale); @@ -314,17 +314,17 @@ ErrorOr MainWidget::create_actions() set_scale_and_save(5); }); m_scale_five_action->set_checked(scale == 5); - m_scale_five_action->set_status_tip(TRY("Scale the editor in proportion to the current font"_string)); + m_scale_five_action->set_status_tip("Scale the editor in proportion to the current font"_string); m_scale_ten_action = GUI::Action::create_checkable("1000%", { Mod_Ctrl, Key_2 }, [this](auto&) { set_scale_and_save(10); }); m_scale_ten_action->set_checked(scale == 10); - m_scale_ten_action->set_status_tip(TRY("Scale the editor in proportion to the current font"_string)); + m_scale_ten_action->set_status_tip("Scale the editor in proportion to the current font"_string); m_scale_fifteen_action = GUI::Action::create_checkable("1500%", { Mod_Ctrl, Key_3 }, [this](auto&) { set_scale_and_save(15); }); m_scale_fifteen_action->set_checked(scale == 15); - m_scale_fifteen_action->set_status_tip(TRY("Scale the editor in proportion to the current font"_string)); + m_scale_fifteen_action->set_status_tip("Scale the editor in proportion to the current font"_string); m_glyph_editor_scale_actions.add_action(*m_scale_five_action); m_glyph_editor_scale_actions.add_action(*m_scale_ten_action); @@ -370,7 +370,7 @@ ErrorOr MainWidget::create_actions() } GUI::Clipboard::the().set_plain_text(builder.to_deprecated_string()); }); - m_copy_text_action->set_status_tip(TRY("Copy to clipboard as text"_string)); + m_copy_text_action->set_status_tip("Copy to clipboard as text"_string); return {}; } diff --git a/Userland/Applications/FontEditor/main.cpp b/Userland/Applications/FontEditor/main.cpp index 37eec854b08..d0fc72c43df 100644 --- a/Userland/Applications/FontEditor/main.cpp +++ b/Userland/Applications/FontEditor/main.cpp @@ -21,7 +21,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix cpath wpath")); auto app = TRY(GUI::Application::create(arguments)); - app->set_config_domain(TRY("FontEditor"_string)); + app->set_config_domain("FontEditor"_string); FontEditor::g_resources = FontEditor::Resources::create(); diff --git a/Userland/Applications/Help/MainWidget.cpp b/Userland/Applications/Help/MainWidget.cpp index 8358e12b123..de0f47a81ba 100644 --- a/Userland/Applications/Help/MainWidget.cpp +++ b/Userland/Applications/Help/MainWidget.cpp @@ -216,7 +216,7 @@ ErrorOr MainWidget::initialize_fallibles(GUI::Window& window) TRY(go_menu->try_add_action(*m_go_home_action)); auto help_menu = TRY(window.try_add_menu("&Help"_short_string)); - String help_page_path = TRY(TRY(try_make_ref_counted(Manual::sections[1 - 1], TRY("Applications/Help"_string)))->path()); + String help_page_path = TRY(TRY(try_make_ref_counted(Manual::sections[1 - 1], "Applications/Help"_string))->path()); TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(&window))); TRY(help_menu->try_add_action(GUI::Action::create("&Contents", { Key_F1 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"sv)), [this, help_page_path = move(help_page_path)](auto&) { open_page(help_page_path); diff --git a/Userland/Applications/HexEditor/HexEditorWidget.cpp b/Userland/Applications/HexEditor/HexEditorWidget.cpp index fe027b33333..373e9448df5 100644 --- a/Userland/Applications/HexEditor/HexEditorWidget.cpp +++ b/Userland/Applications/HexEditor/HexEditorWidget.cpp @@ -502,7 +502,7 @@ ErrorOr HexEditorWidget::initialize_menubar(GUI::Window& window) m_editor->update(); m_bytes_per_row_actions.set_exclusive(true); - auto bytes_per_row_menu = TRY(view_menu->try_add_submenu(TRY("Bytes per &Row"_string))); + auto bytes_per_row_menu = TRY(view_menu->try_add_submenu("Bytes per &Row"_string)); for (int i = 8; i <= 32; i += 8) { auto action = GUI::Action::create_checkable(DeprecatedString::number(i), [this, i](auto&) { m_editor->set_bytes_per_row(i); @@ -516,7 +516,7 @@ ErrorOr HexEditorWidget::initialize_menubar(GUI::Window& window) } m_value_inspector_mode_actions.set_exclusive(true); - auto inspector_mode_menu = TRY(view_menu->try_add_submenu(TRY("Value Inspector &Mode"_string))); + auto inspector_mode_menu = TRY(view_menu->try_add_submenu("Value Inspector &Mode"_string)); auto little_endian_mode = GUI::Action::create_checkable("&Little Endian", [&](auto& action) { m_value_inspector_little_endian = action.is_checked(); update_inspector_values(m_editor->selection_start_offset()); diff --git a/Userland/Applications/HexEditor/ValueInspectorModel.h b/Userland/Applications/HexEditor/ValueInspectorModel.h index e8caf398d2b..243bdb370fb 100644 --- a/Userland/Applications/HexEditor/ValueInspectorModel.h +++ b/Userland/Applications/HexEditor/ValueInspectorModel.h @@ -69,7 +69,7 @@ public: case Column::Type: return "Type"_short_string; case Column::Value: - return m_is_little_endian ? TRY("Value (Little Endian)"_string) : TRY("Value (Big Endian)"_string); + return m_is_little_endian ? "Value (Little Endian)"_string : "Value (Big Endian)"_string; } VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/HexEditor/main.cpp b/Userland/Applications/HexEditor/main.cpp index 29d9cb8bd96..928ba40f5dd 100644 --- a/Userland/Applications/HexEditor/main.cpp +++ b/Userland/Applications/HexEditor/main.cpp @@ -28,7 +28,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Desktop::Launcher::seal_allowlist()); Config::pledge_domain("HexEditor"); - app->set_config_domain(TRY("HexEditor"_string)); + app->set_config_domain("HexEditor"_string); auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-hex-editor"sv)); diff --git a/Userland/Applications/ImageViewer/main.cpp b/Userland/Applications/ImageViewer/main.cpp index 4f8d501e9f9..c805142de43 100644 --- a/Userland/Applications/ImageViewer/main.cpp +++ b/Userland/Applications/ImageViewer/main.cpp @@ -45,7 +45,7 @@ ErrorOr serenity_main(Main::Arguments arguments) Config::pledge_domains({ "ImageViewer", "WindowManager" }); - app->set_config_domain(TRY("ImageViewer"_string)); + app->set_config_domain("ImageViewer"_string); TRY(Desktop::Launcher::add_allowed_handler_with_any_url("/bin/ImageViewer")); TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/Applications/ImageViewer.md") })); @@ -331,7 +331,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(image_menu->try_add_separator()); TRY(image_menu->try_add_action(desktop_wallpaper_action)); - auto navigate_menu = TRY(window->try_add_menu(TRY("&Navigate"_string))); + auto navigate_menu = TRY(window->try_add_menu("&Navigate"_string)); TRY(navigate_menu->try_add_action(go_first_action)); TRY(navigate_menu->try_add_action(go_back_action)); TRY(navigate_menu->try_add_action(go_forward_action)); @@ -346,7 +346,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(view_menu->try_add_action(zoom_out_action)); TRY(view_menu->try_add_separator()); - auto scaling_mode_menu = TRY(view_menu->try_add_submenu(TRY("&Scaling Mode"_string))); + auto scaling_mode_menu = TRY(view_menu->try_add_submenu("&Scaling Mode"_string)); scaling_mode_menu->set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/scale.png"sv))); auto scaling_mode_group = make(); diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp index 947c6c6f553..4d550aacf4c 100644 --- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp +++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp @@ -92,7 +92,7 @@ void KeyboardMapperWidget::create_frame() add_map_radio_button("shift_map"sv, "Shift"_short_string); add_map_radio_button("altgr_map"sv, "AltGr"_short_string); add_map_radio_button("alt_map"sv, "Alt"_short_string); - add_map_radio_button("shift_altgr_map"sv, "Shift+AltGr"_string.release_value_but_fixme_should_propagate_errors()); + add_map_radio_button("shift_altgr_map"sv, "Shift+AltGr"_string); bottom_widget.add_spacer().release_value_but_fixme_should_propagate_errors(); } diff --git a/Userland/Applications/KeyboardMapper/main.cpp b/Userland/Applications/KeyboardMapper/main.cpp index ba1cae7353a..65d34f7e8ed 100644 --- a/Userland/Applications/KeyboardMapper/main.cpp +++ b/Userland/Applications/KeyboardMapper/main.cpp @@ -79,7 +79,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto auto_modifier_action = GUI::Action::create("Auto-Modifier", [&](auto& act) { keyboard_mapper_widget->set_automatic_modifier(act.is_checked()); }); - auto_modifier_action->set_status_tip(TRY("Toggle automatic modifier"_string)); + auto_modifier_action->set_status_tip("Toggle automatic modifier"_string); auto_modifier_action->set_checkable(true); auto_modifier_action->set_checked(false); @@ -90,7 +90,7 @@ ErrorOr serenity_main(Main::Arguments arguments) file_menu.add_separator(); file_menu.add_action(quit_action); - auto& settings_menu = window->add_menu(TRY("&Settings"_string)); + auto& settings_menu = window->add_menu("&Settings"_string); settings_menu.add_action(auto_modifier_action); auto& help_menu = window->add_menu("&Help"_short_string); diff --git a/Userland/Applications/KeyboardSettings/main.cpp b/Userland/Applications/KeyboardSettings/main.cpp index ece5c181822..04e659f910c 100644 --- a/Userland/Applications/KeyboardSettings/main.cpp +++ b/Userland/Applications/KeyboardSettings/main.cpp @@ -37,7 +37,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = TRY(GUI::SettingsWindow::create("Keyboard Settings")); window->set_icon(app_icon.bitmap_for_size(16)); - auto keyboard_settings_widget = TRY(window->add_tab(TRY("Keyboard"_string), "keyboard"sv)); + auto keyboard_settings_widget = TRY(window->add_tab("Keyboard"_string, "keyboard"sv)); window->set_active_tab(selected_tab); window->on_active_window_change = [&](bool is_active_window) { diff --git a/Userland/Applications/Magnifier/main.cpp b/Userland/Applications/Magnifier/main.cpp index 8a70c7b3048..311b48276b8 100644 --- a/Userland/Applications/Magnifier/main.cpp +++ b/Userland/Applications/Magnifier/main.cpp @@ -154,7 +154,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(view_menu->try_add_action(show_grid_action)); TRY(view_menu->try_add_action(choose_grid_color_action)); - auto timeline_menu = TRY(window->try_add_menu(TRY("&Timeline"_string))); + auto timeline_menu = TRY(window->try_add_menu("&Timeline"_string)); auto previous_frame_action = GUI::Action::create( "&Previous frame", { Key_Left }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv)), [&](auto&) { pause_action->set_checked(true); diff --git a/Userland/Applications/MouseSettings/main.cpp b/Userland/Applications/MouseSettings/main.cpp index 6410b7e432f..dbe13433b2a 100644 --- a/Userland/Applications/MouseSettings/main.cpp +++ b/Userland/Applications/MouseSettings/main.cpp @@ -35,8 +35,8 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = TRY(GUI::SettingsWindow::create("Mouse Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes)); (void)TRY(window->add_tab("Mouse"_short_string, "mouse"sv)); - (void)TRY(window->add_tab(TRY("Cursor Theme"_string), "cursor-theme"sv)); - (void)TRY(window->add_tab(TRY("Cursor Highlight"_string), "cursor-highlight"sv)); + (void)TRY(window->add_tab("Cursor Theme"_string, "cursor-theme"sv)); + (void)TRY(window->add_tab("Cursor Highlight"_string, "cursor-highlight"sv)); window->set_icon(app_icon.bitmap_for_size(16)); window->set_active_tab(selected_tab); diff --git a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp index b397e01f6fa..9d6a6f2b2b6 100644 --- a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp +++ b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp @@ -233,7 +233,7 @@ ErrorOr PDFViewerWidget::initialize_menubar(GUI::Window& window) auto view_menu = TRY(window.try_add_menu("&View"_short_string)); TRY(view_menu->try_add_action(*m_toggle_sidebar_action)); TRY(view_menu->try_add_separator()); - auto view_mode_menu = TRY(view_menu->try_add_submenu(TRY("View &Mode"_string))); + auto view_mode_menu = TRY(view_menu->try_add_submenu("View &Mode"_string)); TRY(view_mode_menu->try_add_action(*m_page_view_mode_single)); TRY(view_mode_menu->try_add_action(*m_page_view_mode_multiple)); TRY(view_menu->try_add_separator()); @@ -323,12 +323,12 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar) m_page_view_mode_single = GUI::Action::create_checkable("Single", [&](auto&) { m_viewer->set_page_view_mode(PDFViewer::PageViewMode::Single); }); - m_page_view_mode_single->set_status_tip("Show single page at a time"_string.release_value_but_fixme_should_propagate_errors()); + m_page_view_mode_single->set_status_tip("Show single page at a time"_string); m_page_view_mode_multiple = GUI::Action::create_checkable("Multiple", [&](auto&) { m_viewer->set_page_view_mode(PDFViewer::PageViewMode::Multiple); }); - m_page_view_mode_multiple->set_status_tip("Show multiple pages at a time"_string.release_value_but_fixme_should_propagate_errors()); + m_page_view_mode_multiple->set_status_tip("Show multiple pages at a time"_string); if (m_viewer->page_view_mode() == PDFViewer::PageViewMode::Single) { m_page_view_mode_single->set_checked(true); @@ -351,11 +351,11 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar) toolbar.add_separator(); m_show_clipping_paths = toolbar.add(); - m_show_clipping_paths->set_text("Show clipping paths"_string.release_value_but_fixme_should_propagate_errors()); + m_show_clipping_paths->set_text("Show clipping paths"_string); m_show_clipping_paths->set_checked(m_viewer->show_clipping_paths(), GUI::AllowCallback::No); m_show_clipping_paths->on_checked = [&](auto checked) { m_viewer->set_show_clipping_paths(checked); }; m_show_images = toolbar.add(); - m_show_images->set_text("Show images"_string.release_value_but_fixme_should_propagate_errors()); + m_show_images->set_text("Show images"_string); m_show_images->set_checked(m_viewer->show_images(), GUI::AllowCallback::No); m_show_images->on_checked = [&](auto checked) { m_viewer->set_show_images(checked); }; } diff --git a/Userland/Applications/PDFViewer/SidebarWidget.cpp b/Userland/Applications/PDFViewer/SidebarWidget.cpp index 87dc2925e99..dda993343a0 100644 --- a/Userland/Applications/PDFViewer/SidebarWidget.cpp +++ b/Userland/Applications/PDFViewer/SidebarWidget.cpp @@ -32,7 +32,7 @@ SidebarWidget::SidebarWidget() on_destination_selected(destination); }; - auto& thumbnails_container = tab_bar.add_tab("Thumbnails"_string.release_value_but_fixme_should_propagate_errors()); + auto& thumbnails_container = tab_bar.add_tab("Thumbnails"_string); thumbnails_container.set_layout(4); // FIXME: Add thumbnail previews diff --git a/Userland/Applications/PDFViewer/main.cpp b/Userland/Applications/PDFViewer/main.cpp index 1910989797e..ca1e97d1f0e 100644 --- a/Userland/Applications/PDFViewer/main.cpp +++ b/Userland/Applications/PDFViewer/main.cpp @@ -27,7 +27,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app_icon = GUI::Icon::default_icon("app-pdf-viewer"sv); Config::pledge_domain("PDFViewer"); - app->set_config_domain(TRY("PDFViewer"_string)); + app->set_config_domain("PDFViewer"_string); auto window = TRY(GUI::Window::try_create()); window->set_title("PDF Viewer"); diff --git a/Userland/Applications/PartitionEditor/PartitionModel.cpp b/Userland/Applications/PartitionEditor/PartitionModel.cpp index b69e24efee1..9981de101cb 100644 --- a/Userland/Applications/PartitionEditor/PartitionModel.cpp +++ b/Userland/Applications/PartitionEditor/PartitionModel.cpp @@ -21,13 +21,13 @@ ErrorOr PartitionModel::column_name(int column) const { switch (column) { case Column::Partition: - return TRY("Partition"_string); + return "Partition"_string; case Column::StartBlock: - return TRY("Start Block"_string); + return "Start Block"_string; case Column::EndBlock: - return TRY("End Block"_string); + return "End Block"_string; case Column::TotalBlocks: - return TRY("Total Blocks"_string); + return "Total Blocks"_string; case Column::Size: return "Size"_short_string; default: diff --git a/Userland/Applications/Piano/MainWidget.cpp b/Userland/Applications/Piano/MainWidget.cpp index 8b36f9997ea..fe121547383 100644 --- a/Userland/Applications/Piano/MainWidget.cpp +++ b/Userland/Applications/Piano/MainWidget.cpp @@ -44,7 +44,7 @@ ErrorOr MainWidget::initialize() TRY(m_wave_widget->set_sample_size(sample_count)); m_tab_widget = TRY(try_add()); - m_roll_widget = TRY(m_tab_widget->try_add_tab(TRY("Piano Roll"_string), m_track_manager)); + m_roll_widget = TRY(m_tab_widget->try_add_tab("Piano Roll"_string, m_track_manager)); m_roll_widget->set_fixed_height(300); diff --git a/Userland/Applications/Piano/SamplerWidget.cpp b/Userland/Applications/Piano/SamplerWidget.cpp index 74d0d9e9f77..235402f3fe2 100644 --- a/Userland/Applications/Piano/SamplerWidget.cpp +++ b/Userland/Applications/Piano/SamplerWidget.cpp @@ -60,7 +60,7 @@ SamplerWidget::SamplerWidget(TrackManager& track_manager) m_wave_editor->update(); }; - m_recorded_sample_name = m_open_button_and_recorded_sample_name_container->add("No sample loaded"_string.release_value_but_fixme_should_propagate_errors()); + m_recorded_sample_name = m_open_button_and_recorded_sample_name_container->add("No sample loaded"_string); m_recorded_sample_name->set_text_alignment(Gfx::TextAlignment::CenterLeft); m_wave_editor = add(m_track_manager); diff --git a/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp b/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp index 1a8e96147ad..551898158b5 100644 --- a/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp +++ b/Userland/Applications/PixelPaint/CreateNewImageDialog.cpp @@ -80,7 +80,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window) return BackgroundIndex::Custom; }(); - auto& background_label = main_widget->add("Background:"_string.release_value_but_fixme_should_propagate_errors()); + auto& background_label = main_widget->add("Background:"_string); background_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); auto& background_color_combo = main_widget->add(); auto& background_color_input = main_widget->add(); @@ -110,7 +110,7 @@ CreateNewImageDialog::CreateNewImageDialog(GUI::Window* parent_window) }; auto& set_defaults_checkbox = main_widget->add(); - set_defaults_checkbox.set_text("Use these settings as default"_string.release_value_but_fixme_should_propagate_errors()); + set_defaults_checkbox.set_text("Use these settings as default"_string); auto& button_container = main_widget->add(); button_container.set_layout(); diff --git a/Userland/Applications/PixelPaint/FilterParams.h b/Userland/Applications/PixelPaint/FilterParams.h index 8a685b6d45a..2aa50e004fa 100644 --- a/Userland/Applications/PixelPaint/FilterParams.h +++ b/Userland/Applications/PixelPaint/FilterParams.h @@ -79,7 +79,7 @@ private: } } - auto& norm_checkbox = main_widget->template add("Normalize"_string.release_value_but_fixme_should_propagate_errors()); + auto& norm_checkbox = main_widget->template add("Normalize"_string); norm_checkbox.set_checked(false); auto& wrap_checkbox = main_widget->template add("Wrap"_short_string); diff --git a/Userland/Applications/PixelPaint/Filters/Bloom.cpp b/Userland/Applications/PixelPaint/Filters/Bloom.cpp index eced484fd59..4c493bddcd6 100644 --- a/Userland/Applications/PixelPaint/Filters/Bloom.cpp +++ b/Userland/Applications/PixelPaint/Filters/Bloom.cpp @@ -40,7 +40,7 @@ ErrorOr> Bloom::get_settings_widget() auto settings_widget = TRY(GUI::Widget::try_create()); TRY(settings_widget->try_set_layout()); - auto name_label = TRY(settings_widget->try_add(TRY("Bloom Filter"_string))); + auto name_label = TRY(settings_widget->try_add("Bloom Filter"_string)); name_label->set_font_weight(Gfx::FontWeight::Bold); name_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); name_label->set_fixed_height(20); @@ -49,7 +49,7 @@ ErrorOr> Bloom::get_settings_widget() luma_lower_container->set_fixed_height(50); TRY(luma_lower_container->try_set_layout(GUI::Margins { 4, 0, 4, 0 })); - auto luma_lower_label = TRY(luma_lower_container->try_add(TRY("Luma lower bound:"_string))); + auto luma_lower_label = TRY(luma_lower_container->try_add("Luma lower bound:"_string)); luma_lower_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); luma_lower_label->set_fixed_height(20); @@ -65,7 +65,7 @@ ErrorOr> Bloom::get_settings_widget() radius_container->set_fixed_height(50); TRY(radius_container->try_set_layout(GUI::Margins { 4, 0, 4, 0 })); - auto radius_label = TRY(radius_container->try_add(TRY("Blur Radius:"_string))); + auto radius_label = TRY(radius_container->try_add("Blur Radius:"_string)); radius_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); radius_label->set_fixed_height(20); diff --git a/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp b/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp index efe44bb56af..6fc0daf11a8 100644 --- a/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp +++ b/Userland/Applications/PixelPaint/Filters/FastBoxBlur.cpp @@ -42,12 +42,12 @@ ErrorOr> FastBoxBlur::get_settings_widget() auto settings_widget = TRY(GUI::Widget::try_create()); TRY(settings_widget->try_set_layout()); - auto name_label = TRY(settings_widget->try_add(TRY("Fast Box Blur Filter"_string))); + auto name_label = TRY(settings_widget->try_add("Fast Box Blur Filter"_string)); name_label->set_font_weight(Gfx::FontWeight::Bold); name_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); name_label->set_fixed_height(10); - auto asymmetric_checkbox = TRY(settings_widget->try_add(TRY("Use Asymmetric Radii"_string))); + auto asymmetric_checkbox = TRY(settings_widget->try_add("Use Asymmetric Radii"_string)); asymmetric_checkbox->set_checked(false); asymmetric_checkbox->set_fixed_height(15); asymmetric_checkbox->on_checked = [this](bool checked) { @@ -68,7 +68,7 @@ ErrorOr> FastBoxBlur::get_settings_widget() update_preview(); }; - m_vector_checkbox = TRY(settings_widget->try_add(TRY("Use Direction and magnitude"_string))); + m_vector_checkbox = TRY(settings_widget->try_add("Use Direction and magnitude"_string)); m_vector_checkbox->set_checked(false); m_vector_checkbox->set_visible(false); m_vector_checkbox->set_fixed_height(15); @@ -109,7 +109,7 @@ ErrorOr> FastBoxBlur::get_settings_widget() radius_x_container->set_fixed_height(20); radius_x_container->set_layout(); - auto radius_x_label = TRY(radius_x_container->try_add(TRY("Radius X:"_string))); + auto radius_x_label = TRY(radius_x_container->try_add("Radius X:"_string)); radius_x_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); radius_x_label->set_fixed_size(50, 20); @@ -125,7 +125,7 @@ ErrorOr> FastBoxBlur::get_settings_widget() radius_y_container->set_fixed_height(20); TRY(radius_y_container->try_set_layout()); - auto radius_y_label = TRY(radius_y_container->try_add(TRY("Radius Y:"_string))); + auto radius_y_label = TRY(radius_y_container->try_add("Radius Y:"_string)); radius_y_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); radius_y_label->set_fixed_size(50, 20); @@ -162,7 +162,7 @@ ErrorOr> FastBoxBlur::get_settings_widget() magnitude_container->set_fixed_height(20); TRY(magnitude_container->try_set_layout()); - auto magnitude_label = TRY(magnitude_container->try_add(TRY("Magnitude:"_string))); + auto magnitude_label = TRY(magnitude_container->try_add("Magnitude:"_string)); magnitude_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); magnitude_label->set_fixed_size(60, 20); @@ -178,7 +178,7 @@ ErrorOr> FastBoxBlur::get_settings_widget() gaussian_container->set_fixed_height(20); TRY(gaussian_container->try_set_layout(GUI::Margins { 4, 0, 4, 0 })); - m_gaussian_checkbox = TRY(gaussian_container->try_add(TRY("Approximate Gaussian Blur"_string))); + m_gaussian_checkbox = TRY(gaussian_container->try_add("Approximate Gaussian Blur"_string)); m_gaussian_checkbox->set_checked(m_approximate_gauss); m_gaussian_checkbox->set_tooltip("A real gaussian blur can be approximated by running the box blur multiple times with different weights."); m_gaussian_checkbox->on_checked = [this](bool checked) { diff --git a/Userland/Applications/PixelPaint/Filters/Sepia.cpp b/Userland/Applications/PixelPaint/Filters/Sepia.cpp index f736aa0f191..bb29608f4ab 100644 --- a/Userland/Applications/PixelPaint/Filters/Sepia.cpp +++ b/Userland/Applications/PixelPaint/Filters/Sepia.cpp @@ -23,7 +23,7 @@ ErrorOr> Sepia::get_settings_widget() auto settings_widget = TRY(GUI::Widget::try_create()); TRY(settings_widget->try_set_layout()); - auto name_label = TRY(settings_widget->try_add(TRY("Sepia Filter"_string))); + auto name_label = TRY(settings_widget->try_add("Sepia Filter"_string)); name_label->set_font_weight(Gfx::FontWeight::Bold); name_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); name_label->set_fixed_height(20); diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index 870204a683e..1cbf8505afc 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -30,7 +30,7 @@ constexpr int marching_ant_length = 4; ImageEditor::ImageEditor(NonnullRefPtr image) : m_image(move(image)) - , m_title("Untitled"_string.release_value_but_fixme_should_propagate_errors()) + , m_title("Untitled"_string) , m_gui_event_loop(Core::EventLoop::current()) { set_focus_policy(GUI::FocusPolicy::StrongFocus); diff --git a/Userland/Applications/PixelPaint/LayerPropertiesWidget.cpp b/Userland/Applications/PixelPaint/LayerPropertiesWidget.cpp index fdd752f744d..b99fba8ee75 100644 --- a/Userland/Applications/PixelPaint/LayerPropertiesWidget.cpp +++ b/Userland/Applications/PixelPaint/LayerPropertiesWidget.cpp @@ -45,7 +45,7 @@ LayerPropertiesWidget::LayerPropertiesWidget() opacity_container.set_fixed_height(20); opacity_container.set_layout(); - auto& opacity_label = opacity_container.add("Opacity:"_string.release_value_but_fixme_should_propagate_errors()); + auto& opacity_label = opacity_container.add("Opacity:"_string); opacity_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); opacity_label.set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/MainWidget.cpp b/Userland/Applications/PixelPaint/MainWidget.cpp index 53ccbb94bfc..1489023001c 100644 --- a/Userland/Applications/PixelPaint/MainWidget.cpp +++ b/Userland/Applications/PixelPaint/MainWidget.cpp @@ -1314,7 +1314,7 @@ ErrorOr MainWidget::create_default_image() m_layer_list_widget->set_image(image); auto& editor = create_new_editor(*image); - editor.set_title(TRY("Untitled"_string)); + editor.set_title("Untitled"_string); editor.set_active_layer(bg_layer); editor.set_unmodified(); @@ -1333,7 +1333,7 @@ ErrorOr MainWidget::create_image_from_clipboard() image->add_layer(*layer); auto& editor = create_new_editor(*image); - editor.set_title(TRY("Untitled"_string)); + editor.set_title("Untitled"_string); m_layer_list_widget->set_image(image); m_layer_list_widget->set_selected_layer(layer); @@ -1362,7 +1362,7 @@ ImageEditor* MainWidget::current_image_editor() ImageEditor& MainWidget::create_new_editor(NonnullRefPtr image) { - auto& image_editor = m_tab_widget->add_tab("Untitled"_string.release_value_but_fixme_should_propagate_errors(), image); + auto& image_editor = m_tab_widget->add_tab("Untitled"_string, image); image_editor.on_active_layer_change = [&](auto* layer) { if (current_image_editor() != &image_editor) diff --git a/Userland/Applications/PixelPaint/Tools/BrushTool.cpp b/Userland/Applications/PixelPaint/Tools/BrushTool.cpp index 8fb1f9abeb4..e343ff89faa 100644 --- a/Userland/Applications/PixelPaint/Tools/BrushTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/BrushTool.cpp @@ -167,7 +167,7 @@ ErrorOr BrushTool::get_properties_widget() hardness_container->set_fixed_height(20); (void)TRY(hardness_container->try_set_layout()); - auto hardness_label = TRY(hardness_container->try_add(TRY("Hardness:"_string))); + auto hardness_label = TRY(hardness_container->try_add("Hardness:"_string)); hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); hardness_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/Tools/BucketTool.cpp b/Userland/Applications/PixelPaint/Tools/BucketTool.cpp index 80e4af0799c..76297b54604 100644 --- a/Userland/Applications/PixelPaint/Tools/BucketTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/BucketTool.cpp @@ -71,7 +71,7 @@ ErrorOr BucketTool::get_properties_widget() threshold_container->set_fixed_height(20); (void)TRY(threshold_container->try_set_layout()); - auto threshold_label = TRY(threshold_container->try_add(TRY("Threshold:"_string))); + auto threshold_label = TRY(threshold_container->try_add("Threshold:"_string)); threshold_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); threshold_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/Tools/CloneTool.cpp b/Userland/Applications/PixelPaint/Tools/CloneTool.cpp index 2a858fcc61d..9839383b76f 100644 --- a/Userland/Applications/PixelPaint/Tools/CloneTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/CloneTool.cpp @@ -154,7 +154,7 @@ ErrorOr CloneTool::get_properties_widget() hardness_container->set_fixed_height(20); (void)TRY(hardness_container->try_set_layout()); - auto hardness_label = TRY(hardness_container->try_add(TRY("Hardness:"_string))); + auto hardness_label = TRY(hardness_container->try_add("Hardness:"_string)); hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); hardness_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp b/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp index 759cf6fb32c..95fc8ae53b3 100644 --- a/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/EllipseTool.cpp @@ -136,7 +136,7 @@ ErrorOr EllipseTool::get_properties_widget() thickness_container->set_fixed_height(20); (void)TRY(thickness_container->try_set_layout()); - auto thickness_label = TRY(thickness_container->try_add(TRY("Thickness:"_string))); + auto thickness_label = TRY(thickness_container->try_add("Thickness:"_string)); thickness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); thickness_label->set_fixed_size(80, 20); @@ -159,7 +159,7 @@ ErrorOr EllipseTool::get_properties_widget() (void)TRY(mode_radio_container->try_set_layout()); auto outline_mode_radio = TRY(mode_radio_container->try_add("Outline"_short_string)); auto fill_mode_radio = TRY(mode_radio_container->try_add("Fill"_short_string)); - auto aa_enable_checkbox = TRY(mode_radio_container->try_add(TRY("Anti-alias"_string))); + auto aa_enable_checkbox = TRY(mode_radio_container->try_add("Anti-alias"_string)); aa_enable_checkbox->on_checked = [this](bool checked) { m_antialias_enabled = checked; @@ -180,7 +180,7 @@ ErrorOr EllipseTool::get_properties_widget() aspect_container->set_fixed_height(20); (void)TRY(aspect_container->try_set_layout()); - auto aspect_label = TRY(aspect_container->try_add(TRY("Aspect Ratio:"_string))); + auto aspect_label = TRY(aspect_container->try_add("Aspect Ratio:"_string)); aspect_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); aspect_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/Tools/EraseTool.cpp b/Userland/Applications/PixelPaint/Tools/EraseTool.cpp index 315724ee04e..7e08d5edc6f 100644 --- a/Userland/Applications/PixelPaint/Tools/EraseTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/EraseTool.cpp @@ -82,7 +82,7 @@ ErrorOr EraseTool::get_properties_widget() hardness_container->set_fixed_height(20); (void)TRY(hardness_container->try_set_layout()); - auto hardness_label = TRY(hardness_container->try_add(TRY("Hardness:"_string))); + auto hardness_label = TRY(hardness_container->try_add("Hardness:"_string)); hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); hardness_label->set_fixed_size(80, 20); @@ -101,7 +101,7 @@ ErrorOr EraseTool::get_properties_widget() auto use_secondary_color_checkbox = TRY(secondary_color_container->try_add()); use_secondary_color_checkbox->set_checked(m_use_secondary_color); - use_secondary_color_checkbox->set_text(TRY("Use secondary color"_string)); + use_secondary_color_checkbox->set_text("Use secondary color"_string); use_secondary_color_checkbox->on_checked = [this](bool checked) { m_use_secondary_color = checked; }; @@ -109,7 +109,7 @@ ErrorOr EraseTool::get_properties_widget() auto mode_container = TRY(properties_widget->try_add()); mode_container->set_fixed_height(46); (void)TRY(mode_container->try_set_layout()); - auto mode_label = TRY(mode_container->try_add(TRY("Draw Mode:"_string))); + auto mode_label = TRY(mode_container->try_add("Draw Mode:"_string)); mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); mode_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/Tools/GradientTool.cpp b/Userland/Applications/PixelPaint/Tools/GradientTool.cpp index 3b978726ef4..4e1b665fcd4 100644 --- a/Userland/Applications/PixelPaint/Tools/GradientTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/GradientTool.cpp @@ -207,7 +207,7 @@ ErrorOr GradientTool::get_properties_widget() auto mode_container = TRY(properties_widget->try_add()); mode_container->set_fixed_height(20); (void)TRY(mode_container->try_set_layout()); - auto mode_label = TRY(mode_container->try_add(TRY("Gradient Type:"_string))); + auto mode_label = TRY(mode_container->try_add("Gradient Type:"_string)); mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); mode_label->set_fixed_size(80, 20); @@ -237,7 +237,7 @@ ErrorOr GradientTool::get_properties_widget() opacity_container->set_fixed_height(20); (void)TRY(opacity_container->try_set_layout()); - auto opacity_label = TRY(opacity_container->try_add(TRY("Opacity:"_string))); + auto opacity_label = TRY(opacity_container->try_add("Opacity:"_string)); opacity_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); opacity_label->set_fixed_size(80, 20); @@ -271,7 +271,7 @@ ErrorOr GradientTool::get_properties_widget() hardness_container->set_visible(m_mode == GradientMode::Radial); }; - auto hardness_label = TRY(hardness_container->try_add(TRY("Hardness:"_string))); + auto hardness_label = TRY(hardness_container->try_add("Hardness:"_string)); hardness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); hardness_label->set_fixed_size(80, 20); @@ -286,7 +286,7 @@ ErrorOr GradientTool::get_properties_widget() }; set_secondary_slider(hardness_slider); - auto use_secondary_color_checkbox = TRY(properties_widget->try_add(TRY("Use secondary color"_string))); + auto use_secondary_color_checkbox = TRY(properties_widget->try_add("Use secondary color"_string)); use_secondary_color_checkbox->on_checked = [this](bool checked) { m_use_secondary_color = checked; m_editor->update(); diff --git a/Userland/Applications/PixelPaint/Tools/GuideTool.cpp b/Userland/Applications/PixelPaint/Tools/GuideTool.cpp index 88e2026f22e..10994cffe73 100644 --- a/Userland/Applications/PixelPaint/Tools/GuideTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/GuideTool.cpp @@ -186,7 +186,7 @@ ErrorOr GuideTool::get_properties_widget() snapping_container->set_fixed_height(20); (void)TRY(snapping_container->try_set_layout()); - auto snapping_label = TRY(snapping_container->try_add(TRY("Snap offset:"_string))); + auto snapping_label = TRY(snapping_container->try_add("Snap offset:"_string)); snapping_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); snapping_label->set_fixed_size(80, 20); snapping_label->set_tooltip("Press Shift to snap"); diff --git a/Userland/Applications/PixelPaint/Tools/LineTool.cpp b/Userland/Applications/PixelPaint/Tools/LineTool.cpp index a1d240c4c50..3e6ba018c7d 100644 --- a/Userland/Applications/PixelPaint/Tools/LineTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/LineTool.cpp @@ -129,7 +129,7 @@ ErrorOr LineTool::get_properties_widget() thickness_container->set_fixed_height(20); (void)TRY(thickness_container->try_set_layout()); - auto thickness_label = TRY(thickness_container->try_add(TRY("Thickness:"_string))); + auto thickness_label = TRY(thickness_container->try_add("Thickness:"_string)); thickness_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); thickness_label->set_fixed_size(80, 20); @@ -150,7 +150,7 @@ ErrorOr LineTool::get_properties_widget() mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); mode_label->set_fixed_size(80, 20); - auto aa_enable_checkbox = TRY(mode_container->try_add(TRY("Anti-alias"_string))); + auto aa_enable_checkbox = TRY(mode_container->try_add("Anti-alias"_string)); aa_enable_checkbox->on_checked = [this](bool checked) { m_antialias_enabled = checked; }; diff --git a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp index 5966039ca2b..786e723c4fa 100644 --- a/Userland/Applications/PixelPaint/Tools/MoveTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/MoveTool.cpp @@ -298,15 +298,15 @@ ErrorOr MoveTool::get_properties_widget() auto selection_mode_container = TRY(properties_widget->try_add()); (void)TRY(selection_mode_container->try_set_layout()); selection_mode_container->set_fixed_height(46); - auto selection_mode_label = TRY(selection_mode_container->try_add(TRY("Selection Mode:"_string))); + auto selection_mode_label = TRY(selection_mode_container->try_add("Selection Mode:"_string)); selection_mode_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); selection_mode_label->set_fixed_size(80, 40); auto mode_radio_container = TRY(selection_mode_container->try_add()); (void)TRY(mode_radio_container->try_set_layout()); - m_selection_mode_foreground = TRY(mode_radio_container->try_add(TRY("Foreground"_string))); + m_selection_mode_foreground = TRY(mode_radio_container->try_add("Foreground"_string)); - m_selection_mode_active = TRY(mode_radio_container->try_add(TRY("Active Layer"_string))); + m_selection_mode_active = TRY(mode_radio_container->try_add("Active Layer"_string)); m_selection_mode_foreground->on_checked = [this](bool) { m_layer_selection_mode = LayerSelectionMode::ForegroundLayer; diff --git a/Userland/Applications/PixelPaint/Tools/PenTool.cpp b/Userland/Applications/PixelPaint/Tools/PenTool.cpp index dbb65e36c2e..7f302899e21 100644 --- a/Userland/Applications/PixelPaint/Tools/PenTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/PenTool.cpp @@ -45,7 +45,7 @@ ErrorOr PenTool::get_properties_widget() size_container->set_fixed_height(20); (void)TRY(size_container->try_set_layout()); - auto size_label = TRY(size_container->try_add(TRY("Thickness:"_string))); + auto size_label = TRY(size_container->try_add("Thickness:"_string)); size_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); size_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/Tools/PickerTool.cpp b/Userland/Applications/PixelPaint/Tools/PickerTool.cpp index 906008aaf68..808d6f75323 100644 --- a/Userland/Applications/PixelPaint/Tools/PickerTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/PickerTool.cpp @@ -47,7 +47,7 @@ ErrorOr PickerTool::get_properties_widget() auto properties_widget = TRY(GUI::Widget::try_create()); (void)TRY(properties_widget->try_set_layout()); - auto sample_checkbox = TRY(properties_widget->try_add(TRY("Sample all layers"_string))); + auto sample_checkbox = TRY(properties_widget->try_add("Sample all layers"_string)); sample_checkbox->set_checked(m_sample_all_layers); sample_checkbox->on_checked = [this](bool value) { m_sample_all_layers = value; diff --git a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp index 7428b20cf7d..ca842413f2e 100644 --- a/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/RectangleSelectTool.cpp @@ -165,7 +165,7 @@ ErrorOr RectangleSelectTool::get_properties_widget() (void)TRY(feather_container->try_set_layout()); auto feather_label = TRY(feather_container->try_add()); - feather_label->set_text(TRY("Feather:"_string)); + feather_label->set_text("Feather:"_string); feather_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); feather_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp b/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp index 179ddab5c18..84077f3d74a 100644 --- a/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/RectangleTool.cpp @@ -189,7 +189,7 @@ ErrorOr RectangleTool::get_properties_widget() (void)TRY(mode_radio_container->try_set_layout()); auto outline_mode_radio = TRY(mode_radio_container->try_add("Outline"_short_string)); auto fill_mode_radio = TRY(mode_radio_container->try_add("Fill"_short_string)); - auto gradient_mode_radio = TRY(mode_radio_container->try_add(TRY("Gradient"_string))); + auto gradient_mode_radio = TRY(mode_radio_container->try_add("Gradient"_string)); mode_radio_container->set_fixed_width(70); auto rounded_corners_mode_radio = TRY(mode_radio_container->try_add("Rounded"_short_string)); @@ -215,7 +215,7 @@ ErrorOr RectangleTool::get_properties_widget() auto mode_extras_container = TRY(mode_container->try_add()); (void)TRY(mode_extras_container->try_set_layout()); - auto aa_enable_checkbox = TRY(mode_extras_container->try_add(TRY("Anti-alias"_string))); + auto aa_enable_checkbox = TRY(mode_extras_container->try_add("Anti-alias"_string)); aa_enable_checkbox->on_checked = [this](bool checked) { m_antialias_enabled = checked; }; @@ -225,7 +225,7 @@ ErrorOr RectangleTool::get_properties_widget() (void)TRY(aspect_container->try_set_layout()); aspect_container->set_fixed_width(75); - auto aspect_label = TRY(aspect_container->try_add(TRY("Aspect Ratio:"_string))); + auto aspect_label = TRY(aspect_container->try_add("Aspect Ratio:"_string)); aspect_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); aspect_label->set_fixed_size(75, 20); diff --git a/Userland/Applications/PixelPaint/Tools/SprayTool.cpp b/Userland/Applications/PixelPaint/Tools/SprayTool.cpp index 45750615e41..98b982e6d48 100644 --- a/Userland/Applications/PixelPaint/Tools/SprayTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/SprayTool.cpp @@ -117,7 +117,7 @@ ErrorOr SprayTool::get_properties_widget() density_container->set_fixed_height(20); (void)TRY(density_container->try_set_layout()); - auto density_label = TRY(density_container->try_add(TRY("Density:"_string))); + auto density_label = TRY(density_container->try_add("Density:"_string)); density_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); density_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/Tools/TextTool.cpp b/Userland/Applications/PixelPaint/Tools/TextTool.cpp index 09be4adfcb3..ad946b3f30d 100644 --- a/Userland/Applications/PixelPaint/Tools/TextTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/TextTool.cpp @@ -111,12 +111,12 @@ ErrorOr TextTool::get_properties_widget() auto properties_widget = TRY(GUI::Widget::try_create()); (void)TRY(properties_widget->try_set_layout()); - auto font_header = TRY(properties_widget->try_add(TRY("Current Font:"_string))); + auto font_header = TRY(properties_widget->try_add("Current Font:"_string)); font_header->set_text_alignment(Gfx::TextAlignment::CenterLeft); m_font_label = TRY(properties_widget->try_add(TRY(String::from_deprecated_string(m_selected_font->human_readable_name())))); - auto change_font_button = TRY(properties_widget->try_add(TRY("Change Font..."_string))); + auto change_font_button = TRY(properties_widget->try_add("Change Font..."_string)); change_font_button->on_click = [this](auto) { auto picker = GUI::FontPicker::construct(nullptr, m_selected_font, false); if (picker->exec() == GUI::Dialog::ExecResult::OK) { diff --git a/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp b/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp index 0806d08075b..9dc3283aee8 100644 --- a/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/WandSelectTool.cpp @@ -79,7 +79,7 @@ ErrorOr WandSelectTool::get_properties_widget() threshold_container->set_fixed_height(20); (void)TRY(threshold_container->try_set_layout()); - auto threshold_label = TRY(threshold_container->try_add(TRY("Threshold:"_string))); + auto threshold_label = TRY(threshold_container->try_add("Threshold:"_string)); threshold_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); threshold_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/PixelPaint/Tools/ZoomTool.cpp b/Userland/Applications/PixelPaint/Tools/ZoomTool.cpp index 83c29511b26..bdfc2a5a829 100644 --- a/Userland/Applications/PixelPaint/Tools/ZoomTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/ZoomTool.cpp @@ -33,7 +33,7 @@ ErrorOr ZoomTool::get_properties_widget() sensitivity_container->set_fixed_height(20); (void)TRY(sensitivity_container->try_set_layout()); - auto sensitivity_label = TRY(sensitivity_container->try_add(TRY("Sensitivity:"_string))); + auto sensitivity_label = TRY(sensitivity_container->try_add("Sensitivity:"_string)); sensitivity_label->set_text_alignment(Gfx::TextAlignment::CenterLeft); sensitivity_label->set_fixed_size(80, 20); diff --git a/Userland/Applications/Presenter/PresenterWidget.cpp b/Userland/Applications/Presenter/PresenterWidget.cpp index cfae188d73e..4fe6b5a9160 100644 --- a/Userland/Applications/Presenter/PresenterWidget.cpp +++ b/Userland/Applications/Presenter/PresenterWidget.cpp @@ -71,7 +71,7 @@ ErrorOr PresenterWidget::initialize_menubar() GUI::Application::the()->quit(); }))); - auto presentation_menu = TRY(window->try_add_menu(TRY("&Presentation"_string))); + auto presentation_menu = TRY(window->try_add_menu("&Presentation"_string)); m_next_slide_action = GUI::Action::create("&Next", { KeyCode::Key_Right }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv)), [this](auto&) { if (m_current_presentation) { m_current_presentation->next_frame(); diff --git a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp index a59d65422be..8f689a55760 100644 --- a/Userland/Applications/SoundPlayer/PlaylistWidget.cpp +++ b/Userland/Applications/SoundPlayer/PlaylistWidget.cpp @@ -63,7 +63,7 @@ ErrorOr PlaylistModel::column_name(int column) const case Column::Title: return "Title"_short_string; case Column::Duration: - return TRY("Duration"_string); + return "Duration"_string; case Column::Group: return "Group"_short_string; case Column::Album: @@ -71,7 +71,7 @@ ErrorOr PlaylistModel::column_name(int column) const case Column::Artist: return "Artist"_short_string; case Column::Filesize: - return TRY("Filesize"_string); + return "Filesize"_string; } VERIFY_NOT_REACHED(); } diff --git a/Userland/Applications/SoundPlayer/main.cpp b/Userland/Applications/SoundPlayer/main.cpp index 045b44ccd07..6eb04e8349e 100644 --- a/Userland/Applications/SoundPlayer/main.cpp +++ b/Userland/Applications/SoundPlayer/main.cpp @@ -41,7 +41,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto decoder_client = TRY(ImageDecoderClient::Client::try_create()); Config::pledge_domains({ "SoundPlayer", "FileManager" }); - app->set_config_domain(TRY("SoundPlayer"_string)); + app->set_config_domain("SoundPlayer"_string); TRY(Core::System::pledge("stdio recvfd sendfd rpath thread proc")); @@ -73,7 +73,7 @@ ErrorOr serenity_main(Main::Arguments arguments) app->quit(); }))); - auto playback_menu = TRY(window->try_add_menu(TRY("&Playback"_string))); + auto playback_menu = TRY(window->try_add_menu("&Playback"_string)); GUI::ActionGroup loop_actions; loop_actions.set_exclusive(true); auto loop_none = GUI::Action::create_checkable("&No Loop", { Mod_Ctrl, Key_N }, [&](auto&) { @@ -120,7 +120,7 @@ ErrorOr serenity_main(Main::Arguments arguments) }); TRY(playback_menu->try_add_action(shuffle_mode)); - auto visualization_menu = TRY(window->try_add_menu(TRY("&Visualization"_string))); + auto visualization_menu = TRY(window->try_add_menu("&Visualization"_string)); GUI::ActionGroup visualization_actions; visualization_actions.set_exclusive(true); diff --git a/Userland/Applications/SpaceAnalyzer/ProgressWindow.cpp b/Userland/Applications/SpaceAnalyzer/ProgressWindow.cpp index e9e5ac83ba8..d9d052b75a9 100644 --- a/Userland/Applications/SpaceAnalyzer/ProgressWindow.cpp +++ b/Userland/Applications/SpaceAnalyzer/ProgressWindow.cpp @@ -18,7 +18,7 @@ ErrorOr> ProgressWindow::try_create(StringView tit main_widget->set_fill_with_background_color(true); TRY(main_widget->try_set_layout()); - auto label = TRY(main_widget->try_add(TRY("Analyzing storage space..."_string))); + auto label = TRY(main_widget->try_add("Analyzing storage space..."_string)); label->set_fixed_height(22); window->m_progress_label = TRY(main_widget->try_add()); diff --git a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp index f424fe3d9c6..374be4b7ab2 100644 --- a/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp +++ b/Userland/Applications/SpaceAnalyzer/TreeMapWidget.cpp @@ -433,7 +433,7 @@ ErrorOr TreeMapWidget::analyze(GUI::Statusbar& statusbar) } statusbar.set_text(TRY(builder.to_string())); } else { - statusbar.set_text(TRY("No errors"_string)); + statusbar.set_text("No errors"_string); } m_tree = move(tree); diff --git a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp index 59c516eb9a6..f6166d0d50e 100644 --- a/Userland/Applications/Spreadsheet/CellTypeDialog.cpp +++ b/Userland/Applications/Spreadsheet/CellTypeDialog.cpp @@ -157,7 +157,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector const& po }; { - auto& checkbox = right_side.add("Override max length"_string.release_value_but_fixme_should_propagate_errors()); + auto& checkbox = right_side.add("Override max length"_string); auto& spinbox = right_side.add(); checkbox.set_checked(m_length != -1); spinbox.set_min(0); @@ -177,7 +177,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector const& po }; } { - auto& checkbox = right_side.add("Override display format"_string.release_value_but_fixme_should_propagate_errors()); + auto& checkbox = right_side.add("Override display format"_string); auto& editor = right_side.add(); checkbox.set_checked(!m_format.is_empty()); editor.set_name("format_editor"); @@ -197,7 +197,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector const& po } } - auto& alignment_tab = tabs.add_tab("Alignment"_string.release_value_but_fixme_should_propagate_errors()); + auto& alignment_tab = tabs.add_tab("Alignment"_string); alignment_tab.set_layout(4); { // FIXME: Frame? @@ -209,7 +209,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector const& po auto& horizontal_alignment_label = horizontal_alignment_selection_container.add(); horizontal_alignment_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); - horizontal_alignment_label.set_text("Horizontal text alignment"_string.release_value_but_fixme_should_propagate_errors()); + horizontal_alignment_label.set_text("Horizontal text alignment"_string); auto& horizontal_combobox = alignment_tab.add(); horizontal_combobox.set_only_allow_values_from_model(true); @@ -240,7 +240,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector const& po auto& vertical_alignment_label = vertical_alignment_container.add(); vertical_alignment_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); - vertical_alignment_label.set_text("Vertical text alignment"_string.release_value_but_fixme_should_propagate_errors()); + vertical_alignment_label.set_text("Vertical text alignment"_string); auto& vertical_combobox = alignment_tab.add(); vertical_combobox.set_only_allow_values_from_model(true); @@ -281,7 +281,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector const& po auto& foreground_label = foreground_container.add(); foreground_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); - foreground_label.set_text("Static foreground color"_string.release_value_but_fixme_should_propagate_errors()); + foreground_label.set_text("Static foreground color"_string); auto& foreground_selector = foreground_container.add(); if (m_static_format.foreground_color.has_value()) @@ -300,7 +300,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector const& po auto& background_label = background_container.add(); background_label.set_text_alignment(Gfx::TextAlignment::CenterLeft); - background_label.set_text("Static background color"_string.release_value_but_fixme_should_propagate_errors()); + background_label.set_text("Static background color"_string); auto& background_selector = background_container.add(); if (m_static_format.background_color.has_value()) @@ -312,7 +312,7 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, Vector const& po } } - auto& conditional_fmt_tab = tabs.add_tab("Conditional format"_string.release_value_but_fixme_should_propagate_errors()); + auto& conditional_fmt_tab = tabs.add_tab("Conditional format"_string); conditional_fmt_tab.load_from_gml(cond_fmt_gml).release_value_but_fixme_should_propagate_errors(); { auto& view = *conditional_fmt_tab.find_descendant_of_type_named("conditions_view"); diff --git a/Userland/Applications/Spreadsheet/ImportDialog.cpp b/Userland/Applications/Spreadsheet/ImportDialog.cpp index 19d830b52b2..fe2074b76b6 100644 --- a/Userland/Applications/Spreadsheet/ImportDialog.cpp +++ b/Userland/Applications/Spreadsheet/ImportDialog.cpp @@ -154,7 +154,7 @@ void CSVImportDialogPage::update_preview() m_previously_made_reader = make_reader(); if (!m_previously_made_reader.has_value()) { m_data_preview_table_view->set_model(nullptr); - m_data_preview_error_label->set_text("Could not read the given file"_string.release_value_but_fixme_should_propagate_errors()); + m_data_preview_error_label->set_text("Could not read the given file"_string); m_data_preview_widget->set_active_widget(m_data_preview_error_label); return; } diff --git a/Userland/Applications/Spreadsheet/main.cpp b/Userland/Applications/Spreadsheet/main.cpp index c4f96cc7643..1de6ab18bd7 100644 --- a/Userland/Applications/Spreadsheet/main.cpp +++ b/Userland/Applications/Spreadsheet/main.cpp @@ -42,7 +42,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } Config::pledge_domain("Spreadsheet"); - app->set_config_domain(TRY("Spreadsheet"_string)); + app->set_config_domain("Spreadsheet"_string); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); diff --git a/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp b/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp index a4bfabc5153..f907d605c7c 100644 --- a/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp +++ b/Userland/Applications/SystemMonitor/MemoryStatsWidget.cpp @@ -56,12 +56,12 @@ MemoryStatsWidget::MemoryStatsWidget(GraphWidget* graph) return label; }; - m_physical_pages_label = build_widgets_for_label("Physical memory:"_string.release_value_but_fixme_should_propagate_errors()); - m_physical_pages_committed_label = build_widgets_for_label("Committed memory:"_string.release_value_but_fixme_should_propagate_errors()); - m_kmalloc_space_label = build_widgets_for_label("Kernel heap:"_string.release_value_but_fixme_should_propagate_errors()); - m_kmalloc_count_label = build_widgets_for_label("Calls kmalloc:"_string.release_value_but_fixme_should_propagate_errors()); - m_kfree_count_label = build_widgets_for_label("Calls kfree:"_string.release_value_but_fixme_should_propagate_errors()); - m_kmalloc_difference_label = build_widgets_for_label("Difference:"_string.release_value_but_fixme_should_propagate_errors()); + m_physical_pages_label = build_widgets_for_label("Physical memory:"_string); + m_physical_pages_committed_label = build_widgets_for_label("Committed memory:"_string); + m_kmalloc_space_label = build_widgets_for_label("Kernel heap:"_string); + m_kmalloc_count_label = build_widgets_for_label("Calls kmalloc:"_string); + m_kfree_count_label = build_widgets_for_label("Calls kfree:"_string); + m_kmalloc_difference_label = build_widgets_for_label("Difference:"_string); refresh(); } diff --git a/Userland/Applications/SystemMonitor/NetworkStatisticsWidget.cpp b/Userland/Applications/SystemMonitor/NetworkStatisticsWidget.cpp index be4f56355a0..a5377bd4662 100644 --- a/Userland/Applications/SystemMonitor/NetworkStatisticsWidget.cpp +++ b/Userland/Applications/SystemMonitor/NetworkStatisticsWidget.cpp @@ -53,7 +53,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() net_adapters_fields.empend("name", "Name"_short_string, Gfx::TextAlignment::CenterLeft); net_adapters_fields.empend("class_name", "Class"_short_string, Gfx::TextAlignment::CenterLeft); net_adapters_fields.empend("mac_address", "MAC"_short_string, Gfx::TextAlignment::CenterLeft); - net_adapters_fields.empend("Link status"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterLeft, + net_adapters_fields.empend("Link status"_string, Gfx::TextAlignment::CenterLeft, [](JsonObject const& object) -> DeprecatedString { if (!object.get_bool("link_up"sv).value_or(false)) return "Down"; @@ -67,8 +67,8 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() }); net_adapters_fields.empend("packets_in", "Pkt In"_short_string, Gfx::TextAlignment::CenterRight); net_adapters_fields.empend("packets_out", "Pkt Out"_short_string, Gfx::TextAlignment::CenterRight); - net_adapters_fields.empend("bytes_in", "Bytes In"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight); - net_adapters_fields.empend("bytes_out", "Bytes Out"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight); + net_adapters_fields.empend("bytes_in", "Bytes In"_string, Gfx::TextAlignment::CenterRight); + net_adapters_fields.empend("bytes_out", "Bytes Out"_string, Gfx::TextAlignment::CenterRight); m_adapter_model = GUI::JsonArrayModel::create("/sys/kernel/net/adapters", move(net_adapters_fields)); m_adapter_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_adapter_model))); m_adapter_context_menu = MUST(GUI::Menu::try_create()); @@ -106,8 +106,8 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() net_tcp_fields.empend("sequence_number", "Seq#"_short_string, Gfx::TextAlignment::CenterRight); net_tcp_fields.empend("packets_in", "Pkt In"_short_string, Gfx::TextAlignment::CenterRight); net_tcp_fields.empend("packets_out", "Pkt Out"_short_string, Gfx::TextAlignment::CenterRight); - net_tcp_fields.empend("bytes_in", "Bytes In"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight); - net_tcp_fields.empend("bytes_out", "Bytes Out"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight); + net_tcp_fields.empend("bytes_in", "Bytes In"_string, Gfx::TextAlignment::CenterRight); + net_tcp_fields.empend("bytes_out", "Bytes Out"_string, Gfx::TextAlignment::CenterRight); m_tcp_socket_model = GUI::JsonArrayModel::create("/sys/kernel/net/tcp", move(net_tcp_fields)); m_tcp_socket_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_tcp_socket_model))); diff --git a/Userland/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp b/Userland/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp index 6bd0e8d0f31..0397b857cfb 100644 --- a/Userland/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp +++ b/Userland/Applications/SystemMonitor/ProcessFileDescriptorMapWidget.cpp @@ -29,16 +29,16 @@ ErrorOr> ProcessFileDescriptorMapW TRY(pid_fds_fields.try_empend("Access"_short_string, Gfx::TextAlignment::CenterLeft, [](auto& object) { return object.get_bool("seekable"sv).value_or(false) ? "Seekable" : "Sequential"; })); - TRY(pid_fds_fields.try_empend(TRY("Blocking"_string), Gfx::TextAlignment::CenterLeft, [](auto& object) { + TRY(pid_fds_fields.try_empend("Blocking"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) { return object.get_bool("blocking"sv).value_or(false) ? "Blocking" : "Nonblocking"; })); TRY(pid_fds_fields.try_empend("On exec"_short_string, Gfx::TextAlignment::CenterLeft, [](auto& object) { return object.get_bool("cloexec"sv).value_or(false) ? "Close" : "Keep"; })); - TRY(pid_fds_fields.try_empend(TRY("Can read"_string), Gfx::TextAlignment::CenterLeft, [](auto& object) { + TRY(pid_fds_fields.try_empend("Can read"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) { return object.get_bool("can_read"sv).value_or(false) ? "Yes" : "No"; })); - TRY(pid_fds_fields.try_empend(TRY("Can write"_string), Gfx::TextAlignment::CenterLeft, [](auto& object) { + TRY(pid_fds_fields.try_empend("Can write"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) { return object.get_bool("can_write"sv).value_or(false) ? "Yes" : "No"; })); diff --git a/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp b/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp index 138b89775a6..bad4d355741 100644 --- a/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp +++ b/Userland/Applications/SystemMonitor/ProcessMemoryMapWidget.cpp @@ -61,7 +61,7 @@ ErrorOr> ProcessMemoryMapWidget::try_creat [](auto& object) { return DeprecatedString::formatted("{:p}", object.get_u64("address"sv).value_or(0)); }, [](auto& object) { return object.get_u64("address"sv).value_or(0); })); TRY(pid_vm_fields.try_empend("size", "Size"_short_string, Gfx::TextAlignment::CenterRight)); - TRY(pid_vm_fields.try_empend("amount_resident", TRY("Resident"_string), Gfx::TextAlignment::CenterRight)); + TRY(pid_vm_fields.try_empend("amount_resident", "Resident"_string, Gfx::TextAlignment::CenterRight)); TRY(pid_vm_fields.try_empend("amount_dirty", "Dirty"_short_string, Gfx::TextAlignment::CenterRight)); TRY(pid_vm_fields.try_empend("Access"_short_string, Gfx::TextAlignment::CenterLeft, [](auto& object) { StringBuilder builder; @@ -79,19 +79,19 @@ ErrorOr> ProcessMemoryMapWidget::try_creat builder.append('T'); return builder.to_deprecated_string(); })); - TRY(pid_vm_fields.try_empend(TRY("VMObject type"_string), Gfx::TextAlignment::CenterLeft, [](auto& object) { + TRY(pid_vm_fields.try_empend("VMObject type"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) { auto type = object.get_deprecated_string("vmobject"sv).value_or({}); if (type.ends_with("VMObject"sv)) type = type.substring(0, type.length() - 8); return type; })); - TRY(pid_vm_fields.try_empend(TRY("Purgeable"_string), Gfx::TextAlignment::CenterLeft, [](auto& object) { + TRY(pid_vm_fields.try_empend("Purgeable"_string, Gfx::TextAlignment::CenterLeft, [](auto& object) { if (object.get_bool("volatile"sv).value_or(false)) return "Volatile"; return "Non-volatile"; })); TRY(pid_vm_fields.try_empend( - TRY("Page map"_string), Gfx::TextAlignment::CenterLeft, + "Page map"_string, Gfx::TextAlignment::CenterLeft, [](auto&) { return GUI::Variant(); }, diff --git a/Userland/Applications/SystemMonitor/ProcessModel.cpp b/Userland/Applications/SystemMonitor/ProcessModel.cpp index 8c812100cb4..cc23372570e 100644 --- a/Userland/Applications/SystemMonitor/ProcessModel.cpp +++ b/Userland/Applications/SystemMonitor/ProcessModel.cpp @@ -95,7 +95,7 @@ ErrorOr ProcessModel::column_name(int column) const case Column::Virtual: return "Virtual"_short_string; case Column::Physical: - return TRY("Physical"_string); + return "Physical"_string; case Column::DirtyPrivate: return "Private"_short_string; case Column::CleanInode: @@ -107,11 +107,11 @@ ErrorOr ProcessModel::column_name(int column) const case Column::CPU: return "CPU"_short_string; case Column::Processor: - return TRY("Processor"_string); + return "Processor"_string; case Column::Name: return "Name"_short_string; case Column::Syscalls: - return TRY("Syscalls"_string); + return "Syscalls"_string; case Column::InodeFaults: return "F:Inode"_short_string; case Column::ZeroFaults: @@ -121,15 +121,15 @@ ErrorOr ProcessModel::column_name(int column) const case Column::IPv4SocketReadBytes: return "IPv4 In"_short_string; case Column::IPv4SocketWriteBytes: - return TRY("IPv4 Out"_string); + return "IPv4 Out"_string; case Column::UnixSocketReadBytes: return "Unix In"_short_string; case Column::UnixSocketWriteBytes: - return TRY("Unix Out"_string); + return "Unix Out"_string; case Column::FileReadBytes: return "File In"_short_string; case Column::FileWriteBytes: - return TRY("File Out"_string); + return "File Out"_string; case Column::Pledge: return "Pledge"_short_string; case Column::Veil: diff --git a/Userland/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp b/Userland/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp index 6acc1c3f6a9..0f9399da3af 100644 --- a/Userland/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp +++ b/Userland/Applications/SystemMonitor/ProcessUnveiledPathsWidget.cpp @@ -24,7 +24,7 @@ ErrorOr> ProcessUnveiledPathsWidget::t Vector pid_unveil_fields; TRY(pid_unveil_fields.try_empend("path", "Path"_short_string, Gfx::TextAlignment::CenterLeft)); - TRY(pid_unveil_fields.try_empend("permissions", TRY("Permissions"_string), Gfx::TextAlignment::CenterLeft)); + TRY(pid_unveil_fields.try_empend("permissions", "Permissions"_string, Gfx::TextAlignment::CenterLeft)); widget->m_model = GUI::JsonArrayModel::create({}, move(pid_unveil_fields)); widget->m_table_view->set_model(TRY(GUI::SortingProxyModel::create(*widget->m_model))); diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp index 4a9bcc477ec..f2f8fb553f4 100644 --- a/Userland/Applications/SystemMonitor/main.cpp +++ b/Userland/Applications/SystemMonitor/main.cpp @@ -123,7 +123,7 @@ public: auto& fs_table_view = *self.find_child_of_type_named("storage_table"); Vector df_fields; - df_fields.empend("mount_point", "Mount point"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterLeft); + df_fields.empend("mount_point", "Mount point"_string, Gfx::TextAlignment::CenterLeft); df_fields.empend("class_name", "Class"_short_string, Gfx::TextAlignment::CenterLeft); df_fields.empend("source", "Source"_short_string, Gfx::TextAlignment::CenterLeft); df_fields.empend( @@ -161,7 +161,7 @@ public: return used_blocks * object.get_u64("block_size"sv).value_or(0); }); df_fields.empend( - "Available"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight, + "Available"_string, Gfx::TextAlignment::CenterRight, [](JsonObject const& object) { return human_readable_size(object.get_u64("free_block_count"sv).value_or(0) * object.get_u64("block_size"sv).value_or(0)); }, @@ -173,7 +173,7 @@ public: int mount_flags = object.get_i32("mount_flags"sv).value_or(0); return readonly || (mount_flags & MS_RDONLY) ? "Read-only" : "Read/Write"; }); - df_fields.empend("Mount flags"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterLeft, [](JsonObject const& object) { + df_fields.empend("Mount flags"_string, Gfx::TextAlignment::CenterLeft, [](JsonObject const& object) { int mount_flags = object.get_i32("mount_flags"sv).value_or(0); StringBuilder builder; bool first = true; @@ -197,11 +197,11 @@ public: return DeprecatedString("defaults"); return builder.to_deprecated_string(); }); - df_fields.empend("free_block_count", "Free blocks"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight); - df_fields.empend("total_block_count", "Total blocks"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight); - df_fields.empend("free_inode_count", "Free inodes"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight); - df_fields.empend("total_inode_count", "Total inodes"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight); - df_fields.empend("block_size", "Block size"_string.release_value_but_fixme_should_propagate_errors(), Gfx::TextAlignment::CenterRight); + df_fields.empend("free_block_count", "Free blocks"_string, Gfx::TextAlignment::CenterRight); + df_fields.empend("total_block_count", "Total blocks"_string, Gfx::TextAlignment::CenterRight); + df_fields.empend("free_inode_count", "Free inodes"_string, Gfx::TextAlignment::CenterRight); + df_fields.empend("total_inode_count", "Total inodes"_string, Gfx::TextAlignment::CenterRight); + df_fields.empend("block_size", "Block size"_string, Gfx::TextAlignment::CenterRight); fs_table_view.set_model(MUST(GUI::SortingProxyModel::create(GUI::JsonArrayModel::create("/sys/kernel/df", move(df_fields))))); @@ -446,7 +446,7 @@ ErrorOr serenity_main(Main::Arguments arguments) process_context_menu->popup(event.screen_position(), process_properties_action); }; - auto frequency_menu = TRY(window->try_add_menu(TRY("F&requency"_string))); + auto frequency_menu = TRY(window->try_add_menu("F&requency"_string)); GUI::ActionGroup frequency_action_group; frequency_action_group.set_exclusive(true); diff --git a/Userland/Applications/Terminal/main.cpp b/Userland/Applications/Terminal/main.cpp index 22112255a12..bdcf63e50a4 100644 --- a/Userland/Applications/Terminal/main.cpp +++ b/Userland/Applications/Terminal/main.cpp @@ -141,7 +141,7 @@ static ErrorOr run_command(StringView command, bool keep_open) { auto shell = TRY(String::from_deprecated_string(TRY(Core::Account::self(Core::Account::Read::PasswdOnly)).shell())); if (shell.is_empty()) - shell = TRY("/bin/Shell"_string); + shell = "/bin/Shell"_string; Vector arguments; arguments.append(shell); @@ -193,8 +193,8 @@ static ErrorOr> create_find_window(VT::TerminalWidget find_forwards->click(); }; - auto match_case = TRY(main_widget->try_add(TRY("Case sensitive"_string))); - auto wrap_around = TRY(main_widget->try_add(TRY("Wrap around"_string))); + auto match_case = TRY(main_widget->try_add("Case sensitive"_string)); + auto wrap_around = TRY(main_widget->try_add("Wrap around"_string)); find_backwards->on_click = [&terminal, find_textbox, match_case, wrap_around](auto) { auto needle = find_textbox->text(); @@ -363,14 +363,14 @@ ErrorOr serenity_main(Main::Arguments arguments) Optional close_message; auto title = "Running Process"sv; if (tty_has_foreground_process()) { - close_message = "Close Terminal and kill its foreground process?"_string.release_value_but_fixme_should_propagate_errors(); + close_message = "Close Terminal and kill its foreground process?"_string; } else { auto child_process_count = shell_child_process_count(); if (child_process_count > 1) { title = "Running Processes"sv; close_message = String::formatted("Close Terminal and kill its {} background processes?", child_process_count).release_value_but_fixme_should_propagate_errors(); } else if (child_process_count == 1) { - close_message = "Close Terminal and kill its background process?"_string.release_value_but_fixme_should_propagate_errors(); + close_message = "Close Terminal and kill its background process?"_string; } } if (close_message.has_value()) diff --git a/Userland/Applications/TerminalSettings/main.cpp b/Userland/Applications/TerminalSettings/main.cpp index ff0a5865d7f..6e85e550fdd 100644 --- a/Userland/Applications/TerminalSettings/main.cpp +++ b/Userland/Applications/TerminalSettings/main.cpp @@ -33,7 +33,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto window = TRY(GUI::SettingsWindow::create("Terminal Settings")); window->set_icon(app_icon.bitmap_for_size(16)); (void)TRY(window->add_tab("View"_short_string, "view"sv)); - (void)TRY(window->add_tab(TRY("Terminal"_string), "terminal"sv)); + (void)TRY(window->add_tab("Terminal"_string, "terminal"sv)); window->set_active_tab(selected_tab); window->show(); diff --git a/Userland/Applications/TextEditor/MainWidget.cpp b/Userland/Applications/TextEditor/MainWidget.cpp index 5933915ce5e..3b9fe0103ef 100644 --- a/Userland/Applications/TextEditor/MainWidget.cpp +++ b/Userland/Applications/TextEditor/MainWidget.cpp @@ -317,7 +317,7 @@ MainWidget::MainWidget() Desktop::Launcher::open(URL::create_with_file_scheme(lexical_path.dirname(), lexical_path.basename())); }); m_open_folder_action->set_enabled(!m_path.is_empty()); - m_open_folder_action->set_status_tip("Open the current file location in File Manager"_string.release_value_but_fixme_should_propagate_errors()); + m_open_folder_action->set_status_tip("Open the current file location in File Manager"_string); m_toolbar->add_action(*m_new_action); m_toolbar->add_action(*m_open_action); @@ -481,7 +481,7 @@ ErrorOr MainWidget::initialize_menubar(GUI::Window& window) TRY(view_menu->try_add_separator()); m_wrapping_mode_actions.set_exclusive(true); - auto wrapping_mode_menu = TRY(view_menu->try_add_submenu(TRY("&Wrapping Mode"_string))); + auto wrapping_mode_menu = TRY(view_menu->try_add_submenu("&Wrapping Mode"_string)); m_no_wrapping_action = GUI::Action::create_checkable("&No Wrapping", [&](auto&) { m_editor->set_wrapping_mode(GUI::TextEditor::WrappingMode::NoWrap); Config::write_string("TextEditor"sv, "View"sv, "WrappingMode"sv, "None"sv); @@ -516,7 +516,7 @@ ErrorOr MainWidget::initialize_menubar(GUI::Window& window) } m_soft_tab_width_actions.set_exclusive(true); - auto soft_tab_width_menu = TRY(view_menu->try_add_submenu(TRY("&Tab Width"_string))); + auto soft_tab_width_menu = TRY(view_menu->try_add_submenu("&Tab Width"_string)); m_soft_tab_1_width_action = GUI::Action::create_checkable("1", [&](auto&) { m_editor->set_soft_tab_width(1); }); @@ -557,8 +557,8 @@ ErrorOr MainWidget::initialize_menubar(GUI::Window& window) }); m_visualize_trailing_whitespace_action->set_checked(true); - m_visualize_trailing_whitespace_action->set_status_tip(TRY("Visualize trailing whitespace"_string)); - m_visualize_leading_whitespace_action->set_status_tip(TRY("Visualize leading whitespace"_string)); + m_visualize_trailing_whitespace_action->set_status_tip("Visualize trailing whitespace"_string); + m_visualize_leading_whitespace_action->set_status_tip("Visualize leading whitespace"_string); TRY(view_menu->try_add_action(*m_visualize_trailing_whitespace_action)); TRY(view_menu->try_add_action(*m_visualize_leading_whitespace_action)); @@ -568,7 +568,7 @@ ErrorOr MainWidget::initialize_menubar(GUI::Window& window) }); m_cursor_line_highlighting_action->set_checked(true); - m_cursor_line_highlighting_action->set_status_tip(TRY("Highlight the current line"_string)); + m_cursor_line_highlighting_action->set_status_tip("Highlight the current line"_string); TRY(view_menu->try_add_action(*m_cursor_line_highlighting_action)); @@ -581,7 +581,7 @@ ErrorOr MainWidget::initialize_menubar(GUI::Window& window) m_relative_line_number_action->set_checked(show_relative_line_number); m_editor->set_relative_line_number(show_relative_line_number); - m_relative_line_number_action->set_status_tip(TRY("Set relative line number"_string)); + m_relative_line_number_action->set_status_tip("Set relative line number"_string); TRY(view_menu->try_add_action(*m_relative_line_number_action)); @@ -596,12 +596,12 @@ ErrorOr MainWidget::initialize_menubar(GUI::Window& window) auto syntax_menu = TRY(view_menu->try_add_submenu("&Syntax"_short_string)); m_plain_text_highlight = GUI::Action::create_checkable("&Plain Text", [&](auto&) { - m_statusbar->set_text(1, "Plain Text"_string.release_value_but_fixme_should_propagate_errors()); + m_statusbar->set_text(1, "Plain Text"_string); m_editor->set_syntax_highlighter({}); m_editor->update(); }); m_plain_text_highlight->set_checked(true); - m_statusbar->set_text(1, TRY("Plain Text"_string)); + m_statusbar->set_text(1, "Plain Text"_string); syntax_actions.add_action(*m_plain_text_highlight); TRY(syntax_menu->try_add_action(*m_plain_text_highlight)); @@ -696,12 +696,12 @@ ErrorOr MainWidget::initialize_menubar(GUI::Window& window) }))); TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Text Editor", GUI::Icon::default_icon("app-text-editor"sv), &window))); - auto wrapping_statusbar_menu = TRY(m_line_column_statusbar_menu->try_add_submenu(TRY("&Wrapping Mode"_string))); + auto wrapping_statusbar_menu = TRY(m_line_column_statusbar_menu->try_add_submenu("&Wrapping Mode"_string)); TRY(wrapping_statusbar_menu->try_add_action(*m_no_wrapping_action)); TRY(wrapping_statusbar_menu->try_add_action(*m_wrap_anywhere_action)); TRY(wrapping_statusbar_menu->try_add_action(*m_wrap_at_words_action)); - auto tab_width_statusbar_menu = TRY(m_line_column_statusbar_menu->try_add_submenu(TRY("&Tab Width"_string))); + auto tab_width_statusbar_menu = TRY(m_line_column_statusbar_menu->try_add_submenu("&Tab Width"_string)); TRY(tab_width_statusbar_menu->try_add_action(*m_soft_tab_1_width_action)); TRY(tab_width_statusbar_menu->try_add_action(*m_soft_tab_2_width_action)); TRY(tab_width_statusbar_menu->try_add_action(*m_soft_tab_4_width_action)); diff --git a/Userland/Applications/TextEditor/main.cpp b/Userland/Applications/TextEditor/main.cpp index 11cab94012c..91fe48f84f6 100644 --- a/Userland/Applications/TextEditor/main.cpp +++ b/Userland/Applications/TextEditor/main.cpp @@ -24,7 +24,7 @@ ErrorOr serenity_main(Main::Arguments arguments) Config::pledge_domain("TextEditor"); - app->set_config_domain(TRY("TextEditor"_string)); + app->set_config_domain("TextEditor"_string); auto preview_mode = "auto"sv; StringView file_to_edit; diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp index cb83ef118ef..9340e5768ec 100644 --- a/Userland/Applications/ThemeEditor/main.cpp +++ b/Userland/Applications/ThemeEditor/main.cpp @@ -29,7 +29,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app = TRY(GUI::Application::create(arguments)); Config::pledge_domain("ThemeEditor"); - app->set_config_domain(TRY("ThemeEditor"_string)); + app->set_config_domain("ThemeEditor"_string); StringView file_to_edit; diff --git a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp index c74ec4b2a0e..e22a2d1370f 100644 --- a/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp +++ b/Userland/Applications/VideoPlayer/VideoPlayerWidget.cpp @@ -399,7 +399,7 @@ ErrorOr VideoPlayerWidget::initialize_menubar(GUI::Window& window) }))); // Playback menu - auto playback_menu = TRY(window.try_add_menu(TRY("&Playback"_string))); + auto playback_menu = TRY(window.try_add_menu("&Playback"_string)); // FIXME: Maybe seek mode should be in an options dialog instead. The playback menu may get crowded. // For now, leave it here for convenience. @@ -411,7 +411,7 @@ ErrorOr VideoPlayerWidget::initialize_menubar(GUI::Window& window) auto view_menu = TRY(window.try_add_menu("&View"_short_string)); TRY(view_menu->try_add_action(*m_toggle_fullscreen_action)); - auto sizing_mode_menu = TRY(view_menu->try_add_submenu(TRY("&Sizing Mode"_string))); + auto sizing_mode_menu = TRY(view_menu->try_add_submenu("&Sizing Mode"_string)); sizing_mode_menu->set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fit-image-to-view.png"sv))); m_sizing_mode_group = make(); diff --git a/Userland/Applications/VideoPlayer/main.cpp b/Userland/Applications/VideoPlayer/main.cpp index aa5ff79bc8d..c70906d4572 100644 --- a/Userland/Applications/VideoPlayer/main.cpp +++ b/Userland/Applications/VideoPlayer/main.cpp @@ -24,7 +24,7 @@ ErrorOr serenity_main(Main::Arguments arguments) Config::pledge_domain("VideoPlayer"); auto app = TRY(GUI::Application::create(arguments)); - app->set_config_domain(TRY("VideoPlayer"_string)); + app->set_config_domain("VideoPlayer"_string); auto window = TRY(GUI::Window::try_create()); window->resize(640, 480); diff --git a/Userland/Demos/ModelGallery/GalleryWidget.cpp b/Userland/Demos/ModelGallery/GalleryWidget.cpp index c1ac299b96e..897ef8d7c17 100644 --- a/Userland/Demos/ModelGallery/GalleryWidget.cpp +++ b/Userland/Demos/ModelGallery/GalleryWidget.cpp @@ -24,7 +24,7 @@ GalleryWidget::GalleryWidget() ErrorOr GalleryWidget::load_basic_model_tab() { - auto tab = TRY(m_tab_widget->try_add_tab(TRY("Basic Model"_string))); + auto tab = TRY(m_tab_widget->try_add_tab("Basic Model"_string)); TRY(tab->load_from_gml(basic_model_tab_gml)); m_basic_model = BasicModel::create(); diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp index 323ede41a2f..f27155f1a8a 100644 --- a/Userland/DevTools/GMLPlayground/main.cpp +++ b/Userland/DevTools/GMLPlayground/main.cpp @@ -24,7 +24,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto app = TRY(GUI::Application::create(arguments)); Config::pledge_domains({ "GMLPlayground", "Calendar" }); - app->set_config_domain(TRY("GMLPlayground"_string)); + app->set_config_domain("GMLPlayground"_string); TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); diff --git a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp index c4ff1ebe16e..4e2b018c4e3 100644 --- a/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp +++ b/Userland/DevTools/HackStudio/Debugger/DebugInfoWidget.cpp @@ -148,7 +148,7 @@ RefPtr DebugInfoWidget::get_context_menu_for_variable(const GUI::Mode NonnullRefPtr DebugInfoWidget::build_variables_tab() { auto variables_widget = GUI::Widget::construct(); - variables_widget->set_title("Variables"_string.release_value_but_fixme_should_propagate_errors()); + variables_widget->set_title("Variables"_string); variables_widget->set_layout(); m_variables_view = variables_widget->add(); @@ -165,7 +165,7 @@ NonnullRefPtr DebugInfoWidget::build_variables_tab() NonnullRefPtr DebugInfoWidget::build_registers_tab() { auto registers_widget = GUI::Widget::construct(); - registers_widget->set_title("Registers"_string.release_value_but_fixme_should_propagate_errors()); + registers_widget->set_title("Registers"_string); registers_widget->set_layout(); m_registers_view = registers_widget->add(); diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp index a67b4d93d7c..b45cc7c09f3 100644 --- a/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp +++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyModel.cpp @@ -79,9 +79,9 @@ ErrorOr DisassemblyModel::column_name(int column) const case Column::Address: return "Address"_short_string; case Column::InstructionBytes: - return TRY("Insn Bytes"_string); + return "Insn Bytes"_string; case Column::Disassembly: - return TRY("Disassembly"_string); + return "Disassembly"_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.cpp b/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.cpp index eacbf186aa9..0139a485997 100644 --- a/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.cpp +++ b/Userland/DevTools/HackStudio/Debugger/DisassemblyWidget.cpp @@ -51,7 +51,7 @@ void DisassemblyWidget::update_state(Debug::DebugSession const& debug_session, P if (containing_function.has_value()) m_function_name_label->set_text(String::from_deprecated_string(containing_function.value().name).release_value_but_fixme_should_propagate_errors()); else - m_function_name_label->set_text(""_string.release_value_but_fixme_should_propagate_errors()); + m_function_name_label->set_text(""_string); show_disassembly(); } else { hide_disassembly("No disassembly to show for this function"); diff --git a/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp b/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp index d7568488903..66b0c60c6a7 100644 --- a/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp +++ b/Userland/DevTools/HackStudio/Debugger/RegistersModel.cpp @@ -90,7 +90,7 @@ ErrorOr RegistersModel::column_name(int column) const { switch (column) { case Column::Register: - return TRY("Register"_string); + return "Register"_string; case Column::Value: return "Value"_short_string; default: diff --git a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp index 64bc8648dc3..441874a42a4 100644 --- a/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp +++ b/Userland/DevTools/HackStudio/Dialogs/NewProjectDialog.cpp @@ -115,7 +115,7 @@ void NewProjectDialog::update_dialog() if (project_template) { m_description_label->set_text(String::from_deprecated_string(project_template->description()).release_value_but_fixme_should_propagate_errors()); } else { - m_description_label->set_text("Select a project template to continue."_string.release_value_but_fixme_should_propagate_errors()); + m_description_label->set_text("Select a project template to continue."_string); m_input_valid = false; } @@ -124,7 +124,7 @@ void NewProjectDialog::update_dialog() if (maybe_project_path.has_value()) { m_full_path_label->set_text(String::from_deprecated_string(maybe_project_path.value()).release_value_but_fixme_should_propagate_errors()); } else { - m_full_path_label->set_text("Invalid name or creation directory."_string.release_value_but_fixme_should_propagate_errors()); + m_full_path_label->set_text("Invalid name or creation directory."_string); m_input_valid = false; } diff --git a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp index 77af7c784bd..520f573d0ff 100644 --- a/Userland/DevTools/HackStudio/FindInFilesWidget.cpp +++ b/Userland/DevTools/HackStudio/FindInFilesWidget.cpp @@ -43,7 +43,7 @@ public: { switch (column) { case Column::Filename: - return TRY("Filename"_string); + return "Filename"_string; case Column::Location: return "#"_short_string; case Column::MatchedText: @@ -122,7 +122,7 @@ FindInFilesWidget::FindInFilesWidget() m_textbox = top_container.add(); - m_button = top_container.add("Find"_string.release_value_but_fixme_should_propagate_errors()); + m_button = top_container.add("Find"_string); m_button->set_fixed_width(50); m_result_view = add(); diff --git a/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp b/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp index 6c0c08fcc30..54ab83cd21b 100644 --- a/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp +++ b/Userland/DevTools/HackStudio/GMLPreviewWidget.cpp @@ -22,7 +22,7 @@ void GMLPreviewWidget::load_gml(DeprecatedString const& gml) if (gml.is_empty()) { auto& label = add(); - label.set_text("Open a .gml file to show the preview"_string.release_value_but_fixme_should_propagate_errors()); + label.set_text("Open a .gml file to show the preview"_string); return; } @@ -34,7 +34,7 @@ void GMLPreviewWidget::load_gml(DeprecatedString const& gml) if (children().is_empty()) { auto& label = add(); - label.set_text("Failed to load GML!"_string.release_value_but_fixme_should_propagate_errors()); + label.set_text("Failed to load GML!"_string); } } diff --git a/Userland/DevTools/HackStudio/Git/GitWidget.cpp b/Userland/DevTools/HackStudio/Git/GitWidget.cpp index eea12eecd61..1e48bc3885c 100644 --- a/Userland/DevTools/HackStudio/Git/GitWidget.cpp +++ b/Userland/DevTools/HackStudio/Git/GitWidget.cpp @@ -36,7 +36,7 @@ GitWidget::GitWidget() refresh_button.on_click = [this](int) { refresh(); }; auto& unstaged_label = unstaged_header.add(); - unstaged_label.set_text("Unstaged"_string.release_value_but_fixme_should_propagate_errors()); + unstaged_label.set_text("Unstaged"_string); unstaged_header.set_fixed_height(20); m_unstaged_files = unstaged.add( diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 26aab65b632..9ea2d23d751 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -492,7 +492,7 @@ ErrorOr> HackStudioWidget::create_project_tree_view_con m_tree_view_rename_action = GUI::CommonActions::make_rename_action([this](GUI::Action const&) { m_project_tree_view->begin_editing(m_project_tree_view->cursor_index()); }); - auto project_tree_view_context_menu = GUI::Menu::construct(TRY("Project Files"_string)); + auto project_tree_view_context_menu = GUI::Menu::construct("Project Files"_string); auto& new_file_submenu = project_tree_view_context_menu->add_submenu("N&ew..."_short_string); for (auto& new_file_action : m_new_file_actions) { @@ -777,7 +777,7 @@ void HackStudioWidget::add_new_editor_tab_widget(GUI::Widget& parent) void HackStudioWidget::add_new_editor(GUI::TabWidget& parent) { - auto& wrapper = parent.add_tab("(Untitled)"_string.release_value_but_fixme_should_propagate_errors()); + auto& wrapper = parent.add_tab("(Untitled)"_string); parent.set_active_widget(&wrapper); if (parent.children().size() > 1 || m_all_editor_tab_widgets.size() > 1) parent.set_close_button_enabled(true); @@ -985,7 +985,7 @@ ErrorOr> HackStudioWidget::create_add_terminal_action return GUI::Action::create("Add New &Terminal", { Mod_Ctrl | Mod_Alt, Key_T }, icon, [this](auto&) { - auto& terminal_wrapper = m_action_tab_widget->add_tab("Terminal"_string.release_value_but_fixme_should_propagate_errors()); + auto& terminal_wrapper = m_action_tab_widget->add_tab("Terminal"_string); terminal_wrapper.on_command_exit = [&]() { deferred_invoke([this]() { m_action_tab_widget->remove_tab(*m_action_tab_widget->active_widget()); @@ -1342,7 +1342,7 @@ ErrorOr HackStudioWidget::create_action_tab(GUI::Widget& parent) first_time = false; }; - m_find_in_files_widget = m_action_tab_widget->add_tab(TRY("Find"_string)); + m_find_in_files_widget = m_action_tab_widget->add_tab("Find"_string); m_todo_entries_widget = m_action_tab_widget->add_tab("TODO"_short_string); m_terminal_wrapper = m_action_tab_widget->add_tab("Console"_short_string, false); auto debug_info_widget = TRY(DebugInfoWidget::create()); @@ -1353,13 +1353,13 @@ ErrorOr HackStudioWidget::create_action_tab(GUI::Widget& parent) open_file(get_absolute_path(source_position.file_path), source_position.line_number - 1); }; - m_disassembly_widget = m_action_tab_widget->add_tab(TRY("Disassembly"_string)); + m_disassembly_widget = m_action_tab_widget->add_tab("Disassembly"_string); m_git_widget = m_action_tab_widget->add_tab("Git"_short_string); m_git_widget->set_view_diff_callback([this](auto const& original_content, auto const& diff) { m_diff_viewer->set_content(original_content, diff); set_edit_mode(EditMode::Diff); }); - m_gml_preview_widget = m_action_tab_widget->add_tab(TRY("GML Preview"_string), ""); + m_gml_preview_widget = m_action_tab_widget->add_tab("GML Preview"_string, ""); ToDoEntries::the().on_update = [this]() { m_todo_entries_widget->refresh(); @@ -1432,7 +1432,7 @@ ErrorOr HackStudioWidget::create_file_menu(GUI::Window& window) new_submenu.add_action(*m_new_directory_action); file_menu.add_action(*m_open_action); - m_recent_projects_submenu = &file_menu.add_submenu(TRY("Open &Recent"_string)); + m_recent_projects_submenu = &file_menu.add_submenu("Open &Recent"_string); { auto icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/open-recent.png"sv)); m_recent_projects_submenu->set_icon(icon); @@ -1511,7 +1511,7 @@ ErrorOr HackStudioWidget::create_view_menu(GUI::Window& window) view_menu.add_separator(); m_wrapping_mode_actions.set_exclusive(true); - auto& wrapping_mode_menu = view_menu.add_submenu(TRY("&Wrapping Mode"_string)); + auto& wrapping_mode_menu = view_menu.add_submenu("&Wrapping Mode"_string); m_no_wrapping_action = GUI::Action::create_checkable("&No Wrapping", [&](auto&) { m_wrapping_mode = GUI::TextEditor::WrappingMode::NoWrap; for (auto& wrapper : m_all_editor_wrappers) diff --git a/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp b/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp index 6a4a381147e..6bfa4610697 100644 --- a/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp +++ b/Userland/DevTools/HackStudio/ToDoEntriesWidget.cpp @@ -34,7 +34,7 @@ public: { switch (column) { case Column::Filename: - return TRY("Filename"_string); + return "Filename"_string; case Column::Text: return "Text"_short_string; case Column::Line: diff --git a/Userland/DevTools/Profiler/DisassemblyModel.cpp b/Userland/DevTools/Profiler/DisassemblyModel.cpp index de88b3eee86..58929850503 100644 --- a/Userland/DevTools/Profiler/DisassemblyModel.cpp +++ b/Userland/DevTools/Profiler/DisassemblyModel.cpp @@ -135,15 +135,15 @@ ErrorOr DisassemblyModel::column_name(int column) const { switch (column) { case Column::SampleCount: - return m_profile.show_percentages() ? TRY("% Samples"_string) : TRY("# Samples"_string); + return m_profile.show_percentages() ? "% Samples"_string : "# Samples"_string; case Column::Address: return "Address"_short_string; case Column::InstructionBytes: - return TRY("Insn Bytes"_string); + return "Insn Bytes"_string; case Column::Disassembly: - return TRY("Disassembly"_string); + return "Disassembly"_string; case Column::SourceLocation: - return TRY("Source Location"_string); + return "Source Location"_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/Profiler/FilesystemEventModel.cpp b/Userland/DevTools/Profiler/FilesystemEventModel.cpp index 3d6fefb0352..b07c4120835 100644 --- a/Userland/DevTools/Profiler/FilesystemEventModel.cpp +++ b/Userland/DevTools/Profiler/FilesystemEventModel.cpp @@ -148,9 +148,9 @@ ErrorOr FileEventModel::column_name(int column) const case Column::Path: return "Path"_short_string; case Column::Count: - return TRY("Event Count"_string); + return "Event Count"_string; case Column::Duration: - return TRY("Duration [ms]"_string); + return "Duration [ms]"_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/Profiler/ProfileModel.cpp b/Userland/DevTools/Profiler/ProfileModel.cpp index b1198b8ec15..c2a01a279d1 100644 --- a/Userland/DevTools/Profiler/ProfileModel.cpp +++ b/Userland/DevTools/Profiler/ProfileModel.cpp @@ -78,15 +78,15 @@ ErrorOr ProfileModel::column_name(int column) const { switch (column) { case Column::SampleCount: - return m_profile.show_percentages() ? TRY("% Samples"_string) : TRY("# Samples"_string); + return m_profile.show_percentages() ? "% Samples"_string : "# Samples"_string; case Column::SelfCount: return m_profile.show_percentages() ? "% Self"_short_string : "# Self"_short_string; case Column::ObjectName: return "Object"_short_string; case Column::StackFrame: - return TRY("Stack Frame"_string); + return "Stack Frame"_string; case Column::SymbolAddress: - return TRY("Symbol Address"_string); + return "Symbol Address"_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/Profiler/SamplesModel.cpp b/Userland/DevTools/Profiler/SamplesModel.cpp index 5e33a205553..be9490a5f3e 100644 --- a/Userland/DevTools/Profiler/SamplesModel.cpp +++ b/Userland/DevTools/Profiler/SamplesModel.cpp @@ -34,17 +34,17 @@ ErrorOr SamplesModel::column_name(int column) const case Column::SampleIndex: return "#"_short_string; case Column::Timestamp: - return TRY("Timestamp"_string); + return "Timestamp"_string; case Column::ProcessID: return "PID"_short_string; case Column::ThreadID: return "TID"_short_string; case Column::ExecutableName: - return TRY("Executable"_string); + return "Executable"_string; case Column::LostSamples: - return TRY("Lost Samples"_string); + return "Lost Samples"_string; case Column::InnermostStackFrame: - return TRY("Innermost Frame"_string); + return "Innermost Frame"_string; case Column::Path: return "Path"_short_string; default: diff --git a/Userland/DevTools/Profiler/SignpostsModel.cpp b/Userland/DevTools/Profiler/SignpostsModel.cpp index 896227d8a04..376383f4b73 100644 --- a/Userland/DevTools/Profiler/SignpostsModel.cpp +++ b/Userland/DevTools/Profiler/SignpostsModel.cpp @@ -32,17 +32,17 @@ ErrorOr SignpostsModel::column_name(int column) const case Column::SignpostIndex: return "#"_short_string; case Column::Timestamp: - return TRY("Timestamp"_string); + return "Timestamp"_string; case Column::ProcessID: return "PID"_short_string; case Column::ThreadID: return "TID"_short_string; case Column::ExecutableName: - return TRY("Executable"_string); + return "Executable"_string; case Column::SignpostString: return "String"_short_string; case Column::SignpostArgument: - return TRY("Argument"_string); + return "Argument"_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/DevTools/Profiler/SourceModel.cpp b/Userland/DevTools/Profiler/SourceModel.cpp index 9cda3c952c6..551b595accd 100644 --- a/Userland/DevTools/Profiler/SourceModel.cpp +++ b/Userland/DevTools/Profiler/SourceModel.cpp @@ -126,11 +126,11 @@ ErrorOr SourceModel::column_name(int column) const { switch (column) { case Column::SampleCount: - return m_profile.show_percentages() ? TRY("% Samples"_string) : TRY("# Samples"_string); + return m_profile.show_percentages() ? "% Samples"_string : "# Samples"_string; case Column::SourceCode: - return TRY("Source Code"_string); + return "Source Code"_string; case Column::Location: - return TRY("Location"_string); + return "Location"_string; case Column::LineNumber: return "Line"_short_string; default: diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index c194e7cf158..633a8efffc2 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -131,7 +131,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto tab_widget = TRY(main_splitter->try_add()); - auto tree_tab = TRY(tab_widget->try_add_tab(TRY("Call Tree"_string))); + auto tree_tab = TRY(tab_widget->try_add_tab("Call Tree"_string)); TRY(tree_tab->try_set_layout(4)); auto bottom_splitter = TRY(tree_tab->try_add()); @@ -180,7 +180,7 @@ ErrorOr serenity_main(Main::Arguments arguments) update_source_model(); }); - auto samples_tab = TRY(tab_widget->try_add_tab(TRY("Samples"_string))); + auto samples_tab = TRY(tab_widget->try_add_tab("Samples"_string)); TRY(samples_tab->try_set_layout(4)); auto samples_splitter = TRY(samples_tab->try_add()); @@ -194,7 +194,7 @@ ErrorOr serenity_main(Main::Arguments arguments) individual_sample_view->set_model(move(model)); }; - auto signposts_tab = TRY(tab_widget->try_add_tab(TRY("Signposts"_string))); + auto signposts_tab = TRY(tab_widget->try_add_tab("Signposts"_string)); TRY(signposts_tab->try_set_layout(4)); auto signposts_splitter = TRY(signposts_tab->try_add()); @@ -208,7 +208,7 @@ ErrorOr serenity_main(Main::Arguments arguments) individual_signpost_view->set_model(move(model)); }; - auto flamegraph_tab = TRY(tab_widget->try_add_tab(TRY("Flame Graph"_string))); + auto flamegraph_tab = TRY(tab_widget->try_add_tab("Flame Graph"_string)); TRY(flamegraph_tab->try_set_layout(GUI::Margins { 4, 4, 4, 4 })); auto flamegraph_view = TRY(flamegraph_tab->try_add(profile->model(), ProfileModel::Column::StackFrame, ProfileModel::Column::SampleCount)); @@ -256,7 +256,7 @@ ErrorOr serenity_main(Main::Arguments arguments) timeline_view->on_selection_change = [&] { statusbar_update(); }; flamegraph_view->on_hover_change = [&] { statusbar_update(); }; - auto filesystem_events_tab = TRY(tab_widget->try_add_tab(TRY("Filesystem events"_string))); + auto filesystem_events_tab = TRY(tab_widget->try_add_tab("Filesystem events"_string)); TRY(filesystem_events_tab->try_set_layout(4)); auto filesystem_events_tree_view = TRY(filesystem_events_tab->try_add()); diff --git a/Userland/DevTools/SQLStudio/MainWidget.cpp b/Userland/DevTools/SQLStudio/MainWidget.cpp index 27dca8fc987..b24e4b5a964 100644 --- a/Userland/DevTools/SQLStudio/MainWidget.cpp +++ b/Userland/DevTools/SQLStudio/MainWidget.cpp @@ -164,7 +164,7 @@ ErrorOr MainWidget::setup() return; m_run_script_action->set_enabled(false); - m_statusbar->set_text(1, "Disconnected"_string.release_value_but_fixme_should_propagate_errors()); + m_statusbar->set_text(1, "Disconnected"_string); if (m_connection_id.has_value()) { m_sql_client->disconnect(*m_connection_id); @@ -245,7 +245,7 @@ ErrorOr MainWidget::setup() m_statusbar = find_descendant_of_type_named("statusbar"sv); m_statusbar->segment(1).set_mode(GUI::Statusbar::Segment::Mode::Auto); - m_statusbar->set_text(1, TRY("Disconnected"_string)); + m_statusbar->set_text(1, "Disconnected"_string); m_statusbar->segment(2).set_mode(GUI::Statusbar::Segment::Mode::Fixed); m_statusbar->segment(2).set_fixed_width(font().width("Ln 0,000 Col 000"sv) + font().max_glyph_width()); diff --git a/Userland/Games/Chess/main.cpp b/Userland/Games/Chess/main.cpp index 2396d6dda05..10c226888c8 100644 --- a/Userland/Games/Chess/main.cpp +++ b/Userland/Games/Chess/main.cpp @@ -145,7 +145,7 @@ ErrorOr serenity_main(Main::Arguments arguments) GUI::Process::spawn_or_show_error(window, "/bin/GamesSettings"sv, Array { "--open-tab", "chess" }); }, window); - settings_action->set_status_tip(TRY("Open the Game Settings for Chess"_string)); + settings_action->set_status_tip("Open the Game Settings for Chess"_string); TRY(game_menu->try_add_action(settings_action)); auto show_available_moves_action = GUI::Action::create_checkable("Show Available Moves", [&](auto& action) { diff --git a/Userland/Games/GameOfLife/BoardWidget.cpp b/Userland/Games/GameOfLife/BoardWidget.cpp index ae8729a22cf..6d889d6712a 100644 --- a/Userland/Games/GameOfLife/BoardWidget.cpp +++ b/Userland/Games/GameOfLife/BoardWidget.cpp @@ -186,7 +186,7 @@ void BoardWidget::context_menu_event(GUI::ContextMenuEvent& event) if (!m_context_menu) { m_context_menu = GUI::Menu::construct(); - auto& insert_pattern_menu = m_context_menu->add_submenu("&Insert Pattern"_string.release_value_but_fixme_should_propagate_errors()); + auto& insert_pattern_menu = m_context_menu->add_submenu("&Insert Pattern"_string); for_each_pattern([&](auto& pattern) { if (pattern.action()) insert_pattern_menu.add_action(*pattern.action()); diff --git a/Userland/Games/GameOfLife/main.cpp b/Userland/Games/GameOfLife/main.cpp index 038f6fa0c08..86ef83db37e 100644 --- a/Userland/Games/GameOfLife/main.cpp +++ b/Userland/Games/GameOfLife/main.cpp @@ -39,7 +39,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - auto click_tip = TRY("Tip: click the board to toggle individual cells, or click+drag to toggle multiple cells"_string); + auto click_tip = "Tip: click the board to toggle individual cells, or click+drag to toggle multiple cells"_string; auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-gameoflife"sv)); @@ -153,7 +153,7 @@ ErrorOr serenity_main(Main::Arguments arguments) board_widget->on_running_state_change = [&]() { if (board_widget->is_running()) { - statusbar.set_text("Running..."_string.release_value_but_fixme_should_propagate_errors()); + statusbar.set_text("Running..."_string); toggle_running_toolbar_button->set_icon(*paused_icon); main_widget->set_override_cursor(Gfx::StandardCursor::None); } else { @@ -177,7 +177,7 @@ ErrorOr serenity_main(Main::Arguments arguments) board_widget->on_stall = [&] { toggle_running_action->activate(); - statusbar.set_text("Stalled..."_string.release_value_but_fixme_should_propagate_errors()); + statusbar.set_text("Stalled..."_string); }; board_widget->on_cell_toggled = [&](auto, auto, auto) { diff --git a/Userland/Games/Hearts/Game.cpp b/Userland/Games/Hearts/Game.cpp index dd273a8b0f6..05885e3d5c6 100644 --- a/Userland/Games/Hearts/Game.cpp +++ b/Userland/Games/Hearts/Game.cpp @@ -78,7 +78,7 @@ Game::Game() m_players[3].name = "Lisa"; m_players[3].taken_cards_target = { width, height / 2 - Card::height / 2 }; - m_passing_button = add("Pass Left"_string.release_value_but_fixme_should_propagate_errors()); + m_passing_button = add("Pass Left"_string); constexpr int button_width = 120; constexpr int button_height = 30; m_passing_button->set_relative_rect(width / 2 - button_width / 2, height - 3 * outer_border_size - Card::height - button_height, button_width, button_height); @@ -178,13 +178,13 @@ void Game::setup(DeprecatedString player_name, int hand_number) m_human_can_play = true; switch (passing_direction()) { case PassingDirection::Left: - m_passing_button->set_text("Pass Left"_string.release_value_but_fixme_should_propagate_errors()); + m_passing_button->set_text("Pass Left"_string); break; case PassingDirection::Across: - m_passing_button->set_text("Pass Across"_string.release_value_but_fixme_should_propagate_errors()); + m_passing_button->set_text("Pass Across"_string); break; case PassingDirection::Right: - m_passing_button->set_text("Pass Right"_string.release_value_but_fixme_should_propagate_errors()); + m_passing_button->set_text("Pass Right"_string); break; default: VERIFY_NOT_REACHED(); @@ -405,7 +405,7 @@ void Game::let_player_play_card() auto& player = current_player(); if (&player == &m_players[0]) - on_status_change("Select a card to play."_string.release_value_but_fixme_should_propagate_errors()); + on_status_change("Select a card to play."_string); else on_status_change(String::formatted("Waiting for {} to play a card...", player).release_value_but_fixme_should_propagate_errors()); @@ -455,7 +455,7 @@ void Game::advance_game() if (m_state == State::Play && game_ended()) { m_state = State::GameEnded; - on_status_change("Game ended."_string.release_value_but_fixme_should_propagate_errors()); + on_status_change("Game ended."_string); advance_game(); return; } diff --git a/Userland/Games/Hearts/main.cpp b/Userland/Games/Hearts/main.cpp index 66c8af186d5..240ec569b0a 100644 --- a/Userland/Games/Hearts/main.cpp +++ b/Userland/Games/Hearts/main.cpp @@ -57,7 +57,7 @@ ErrorOr serenity_main(Main::Arguments arguments) game.set_focus(true); auto& statusbar = *widget->find_descendant_of_type_named("statusbar"); - statusbar.set_text(0, TRY("Score: 0"_string)); + statusbar.set_text(0, "Score: 0"_string); DeprecatedString player_name = Config::read_string("Hearts"sv, ""sv, "player_name"sv, "Gunnar"sv); diff --git a/Userland/Games/MasterWord/main.cpp b/Userland/Games/MasterWord/main.cpp index 01c10676cc1..b0608b62dcb 100644 --- a/Userland/Games/MasterWord/main.cpp +++ b/Userland/Games/MasterWord/main.cpp @@ -77,7 +77,7 @@ ErrorOr serenity_main(Main::Arguments arguments) GUI::Application::the()->quit(); }))); - auto settings_menu = TRY(window->try_add_menu(TRY("&Settings"_string))); + auto settings_menu = TRY(window->try_add_menu("&Settings"_string)); TRY(settings_menu->try_add_action(GUI::Action::create("Set &Word Length...", [&](auto&) { auto word_length = Config::read_i32("MasterWord"sv, ""sv, "word_length"sv, 5); diff --git a/Userland/Games/Minesweeper/main.cpp b/Userland/Games/Minesweeper/main.cpp index d2bcdda6805..9850c463796 100644 --- a/Userland/Games/Minesweeper/main.cpp +++ b/Userland/Games/Minesweeper/main.cpp @@ -78,7 +78,7 @@ ErrorOr serenity_main(Main::Arguments arguments) GUI::Application::the()->quit(); }))); - auto difficulty_menu = TRY(window->try_add_menu(TRY("&Difficulty"_string))); + auto difficulty_menu = TRY(window->try_add_menu("&Difficulty"_string)); GUI::ActionGroup difficulty_actions; difficulty_actions.set_exclusive(true); diff --git a/Userland/Games/Snake/main.cpp b/Userland/Games/Snake/main.cpp index 7ff0efb7496..f6f1651081d 100644 --- a/Userland/Games/Snake/main.cpp +++ b/Userland/Games/Snake/main.cpp @@ -62,7 +62,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto snake_skin_name = Config::read_string("Snake"sv, "Snake"sv, "SnakeSkin"sv, "Classic"sv); auto& statusbar = *widget->find_descendant_of_type_named("statusbar"sv); - statusbar.set_text(0, TRY("Score: 0"_string)); + statusbar.set_text(0, "Score: 0"_string); statusbar.set_text(1, TRY(String::formatted("High Score: {}", high_score))); GUI::Application::the()->on_action_enter = [&statusbar](GUI::Action& action) { statusbar.set_override_text(action.status_tip()); diff --git a/Userland/Games/Solitaire/main.cpp b/Userland/Games/Solitaire/main.cpp index 77c993e3047..0e6c3868282 100644 --- a/Userland/Games/Solitaire/main.cpp +++ b/Userland/Games/Solitaire/main.cpp @@ -91,9 +91,9 @@ ErrorOr serenity_main(Main::Arguments arguments) game.set_focus(true); auto& statusbar = *widget->find_descendant_of_type_named("statusbar"); - statusbar.set_text(0, TRY("Score: 0"_string)); + statusbar.set_text(0, "Score: 0"_string); statusbar.set_text(1, TRY(String::formatted("High Score: {}", high_score()))); - statusbar.set_text(2, TRY("Time: 00:00"_string)); + statusbar.set_text(2, "Time: 00:00"_string); app->on_action_enter = [&](GUI::Action& action) { statusbar.set_override_text(action.status_tip()); @@ -117,7 +117,7 @@ ErrorOr serenity_main(Main::Arguments arguments) game.on_game_start = [&]() { seconds_elapsed = 0; timer->start(); - statusbar.set_text(2, "Time: 00:00"_string.release_value_but_fixme_should_propagate_errors()); + statusbar.set_text(2, "Time: 00:00"_string); }; game.on_game_end = [&](Solitaire::GameOverReason reason, uint32_t score) { if (timer->is_active()) @@ -135,7 +135,7 @@ ErrorOr serenity_main(Main::Arguments arguments) statusbar.set_text(1, String::formatted("High Score: {}", score).release_value_but_fixme_should_propagate_errors()); } } - statusbar.set_text(2, "Timer starts after your first move"_string.release_value_but_fixme_should_propagate_errors()); + statusbar.set_text(2, "Timer starts after your first move"_string); }; auto confirm_end_current_game = [&]() { @@ -172,7 +172,7 @@ ErrorOr serenity_main(Main::Arguments arguments) game.setup(mode); }); single_card_draw_action->set_checked(mode == Solitaire::Mode::SingleCardDraw); - single_card_draw_action->set_status_tip(TRY("Draw one card at a time"_string)); + single_card_draw_action->set_status_tip("Draw one card at a time"_string); draw_setting_actions.add_action(single_card_draw_action); auto three_card_draw_action = GUI::Action::create_checkable("&Three Card Draw", [&](auto&) { @@ -185,7 +185,7 @@ ErrorOr serenity_main(Main::Arguments arguments) game.setup(mode); }); three_card_draw_action->set_checked(mode == Solitaire::Mode::ThreeCardDraw); - three_card_draw_action->set_status_tip(TRY("Draw three cards at a time"_string)); + three_card_draw_action->set_status_tip("Draw three cards at a time"_string); draw_setting_actions.add_action(three_card_draw_action); game.set_auto_collect(Config::read_bool("Solitaire"sv, "Settings"sv, "AutoCollect"sv, false)); @@ -195,7 +195,7 @@ ErrorOr serenity_main(Main::Arguments arguments) Config::write_bool("Solitaire"sv, "Settings"sv, "AutoCollect"sv, checked); }); toggle_auto_collect_action->set_checked(game.is_auto_collecting()); - toggle_auto_collect_action->set_status_tip(TRY("Auto-collect to foundation piles"_string)); + toggle_auto_collect_action->set_status_tip("Auto-collect to foundation piles"_string); auto game_menu = TRY(window->try_add_menu("&Game"_short_string)); diff --git a/Userland/Games/Spider/main.cpp b/Userland/Games/Spider/main.cpp index a7af3676a12..70eefa2b1c8 100644 --- a/Userland/Games/Spider/main.cpp +++ b/Userland/Games/Spider/main.cpp @@ -129,9 +129,9 @@ ErrorOr serenity_main(Main::Arguments arguments) } }; - statusbar.set_text(0, TRY("Score: 0"_string)); + statusbar.set_text(0, "Score: 0"_string); reset_statistic_status(); - statusbar.set_text(2, TRY("Time: 00:00:00"_string)); + statusbar.set_text(2, "Time: 00:00:00"_string); app->on_action_enter = [&](GUI::Action& action) { statusbar.set_override_text(action.status_tip()); @@ -156,7 +156,7 @@ ErrorOr serenity_main(Main::Arguments arguments) game.on_game_start = [&]() { seconds_elapsed = 0; timer->start(); - statusbar.set_text(2, "Time: 00:00:00"_string.release_value_but_fixme_should_propagate_errors()); + statusbar.set_text(2, "Time: 00:00:00"_string); }; game.on_game_end = [&](Spider::GameOverReason reason, uint32_t score) { auto game_was_in_progress = timer->is_active(); @@ -181,7 +181,7 @@ ErrorOr serenity_main(Main::Arguments arguments) reset_statistic_status(); } - statusbar.set_text(2, "Timer starts after your first move"_string.release_value_but_fixme_should_propagate_errors()); + statusbar.set_text(2, "Timer starts after your first move"_string); }; auto confirm_end_current_game = [&]() { diff --git a/Userland/Libraries/LibCards/CardGame.cpp b/Userland/Libraries/LibCards/CardGame.cpp index 3a6c75f7de5..378388eb88b 100644 --- a/Userland/Libraries/LibCards/CardGame.cpp +++ b/Userland/Libraries/LibCards/CardGame.cpp @@ -23,7 +23,7 @@ ErrorOr> make_cards_settings_action(GUI::Window* pare GUI::Process::spawn_or_show_error(parent, "/bin/GamesSettings"sv, Array { "--open-tab", "cards" }); }, parent); - action->set_status_tip(TRY("Open the Game Settings for Cards"_string)); + action->set_status_tip("Open the Game Settings for Cards"_string); return action; } diff --git a/Userland/Libraries/LibCodeComprehension/Shell/ShellComprehensionEngine.cpp b/Userland/Libraries/LibCodeComprehension/Shell/ShellComprehensionEngine.cpp index d8931d3d5bc..58639b760a3 100644 --- a/Userland/Libraries/LibCodeComprehension/Shell/ShellComprehensionEngine.cpp +++ b/Userland/Libraries/LibCodeComprehension/Shell/ShellComprehensionEngine.cpp @@ -108,7 +108,7 @@ NonnullRefPtr<::Shell::AST::Node> ShellComprehensionEngine::DocumentData::parse( if (auto node = parser.parse()) return node.release_nonnull(); - return ::Shell::AST::make_ref_counted<::Shell::AST::SyntaxError>(::Shell::AST::Position {}, "Unable to parse file"_string.release_value_but_fixme_should_propagate_errors()); + return ::Shell::AST::make_ref_counted<::Shell::AST::SyntaxError>(::Shell::AST::Position {}, "Unable to parse file"_string); } size_t ShellComprehensionEngine::resolve(ShellComprehensionEngine::DocumentData const& document, const GUI::TextPosition& position) diff --git a/Userland/Libraries/LibCore/StandardPaths.cpp b/Userland/Libraries/LibCore/StandardPaths.cpp index 5157c7073c2..d3dc5147fad 100644 --- a/Userland/Libraries/LibCore/StandardPaths.cpp +++ b/Userland/Libraries/LibCore/StandardPaths.cpp @@ -116,14 +116,14 @@ ErrorOr> StandardPaths::font_directories() { return Vector { { #if defined(AK_OS_SERENITY) - TRY("/res/fonts"_string), + "/res/fonts"_string, #elif defined(AK_OS_MACOS) - TRY("/System/Library/Fonts"_string), - TRY("/Library/Fonts"_string), + "/System/Library/Fonts"_string, + "/Library/Fonts"_string, TRY(String::formatted("{}/Library/Fonts"sv, home_directory())), #else - TRY("/usr/share/fonts"_string), - TRY("/usr/local/share/fonts"_string), + "/usr/share/fonts"_string, + "/usr/local/share/fonts"_string, TRY(String::formatted("{}/.local/share/fonts"sv, home_directory())), #endif } }; diff --git a/Userland/Libraries/LibGLSL/Linker.cpp b/Userland/Libraries/LibGLSL/Linker.cpp index 0d9fb3e66ab..3503b880521 100644 --- a/Userland/Libraries/LibGLSL/Linker.cpp +++ b/Userland/Libraries/LibGLSL/Linker.cpp @@ -15,8 +15,8 @@ ErrorOr> Linker::link(Vector cons GPU::IR::Shader shader; - auto input_name = TRY("input0"_string); - auto output_name = TRY("output0"_string); + auto input_name = "input0"_string; + auto output_name = "output0"_string; TRY(shader.inputs.try_append({ move(input_name), GPU::IR::StorageType::Vector4 })); TRY(shader.outputs.try_append({ move(output_name), GPU::IR::StorageType::Vector4 })); GPU::IR::Instruction instruction { diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp index 6f554671ad7..f4d5696b59c 100644 --- a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp @@ -108,7 +108,7 @@ AutocompleteBox::AutocompleteBox(TextEditor& editor) apply_suggestion(); }; - m_no_suggestions_view = main_widget->add("No suggestions"_string.release_value_but_fixme_should_propagate_errors()); + m_no_suggestions_view = main_widget->add("No suggestions"_string); } void AutocompleteBox::update_suggestions(Vector&& suggestions) diff --git a/Userland/Libraries/LibGUI/ColorPicker.cpp b/Userland/Libraries/LibGUI/ColorPicker.cpp index d1cf66e1dfa..3804412f15a 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.cpp +++ b/Userland/Libraries/LibGUI/ColorPicker.cpp @@ -218,7 +218,7 @@ void ColorPicker::build_ui() build_ui_palette(tab_palette); - auto& tab_custom_color = tab_widget.add_tab("Custom Color"_string.release_value_but_fixme_should_propagate_errors()); + auto& tab_custom_color = tab_widget.add_tab("Custom Color"_string); tab_custom_color.set_layout(4, 4); build_ui_custom(tab_custom_color); @@ -412,7 +412,7 @@ void ColorPicker::build_ui_custom(Widget& root_container) make_spinbox(Blue, m_color.blue()); make_spinbox(Alpha, m_color.alpha()); - m_selector_button = vertical_container.add("Select on Screen"_string.release_value_but_fixme_should_propagate_errors()); + m_selector_button = vertical_container.add("Select on Screen"_string); m_selector_button->on_click = [this](auto) { auto selector = ColorSelectOverlay::construct(); auto original_color = m_color; diff --git a/Userland/Libraries/LibGUI/CommonActions.cpp b/Userland/Libraries/LibGUI/CommonActions.cpp index 48030b2eaf9..6e6b8956fba 100644 --- a/Userland/Libraries/LibGUI/CommonActions.cpp +++ b/Userland/Libraries/LibGUI/CommonActions.cpp @@ -28,42 +28,42 @@ NonnullRefPtr make_about_action(DeprecatedString const& app_name, Icon c weak_parent) .release_value_but_fixme_should_propagate_errors(); }); - action->set_status_tip("Show application about box"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Show application about box"_string); return action; } NonnullRefPtr make_open_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("&Open...", { Mod_Ctrl, Key_O }, Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Open an existing file"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Open an existing file"_string); return action; } NonnullRefPtr make_save_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("&Save", { Mod_Ctrl, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Save the current file"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Save the current file"_string); return action; } NonnullRefPtr make_save_as_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("Save &As...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/save-as.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Save the current file with a new name"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Save the current file with a new name"_string); return action; } NonnullRefPtr make_move_to_front_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("Move to &Front", { Mod_Ctrl | Mod_Shift, Key_Up }, Gfx::Bitmap::load_from_file("/res/icons/16x16/move-to-front.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Move to the top of the stack"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Move to the top of the stack"_string); return action; } NonnullRefPtr make_move_to_back_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("Move to &Back", { Mod_Ctrl | Mod_Shift, Key_Down }, Gfx::Bitmap::load_from_file("/res/icons/16x16/move-to-back.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Move to the bottom of the stack"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Move to the bottom of the stack"_string); return action; } @@ -85,35 +85,35 @@ NonnullRefPtr make_delete_action(Function callback, Core: NonnullRefPtr make_cut_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("Cu&t", { Mod_Ctrl, Key_X }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-cut.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Cut to clipboard"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Cut to clipboard"_string); return action; } NonnullRefPtr make_copy_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("&Copy", { Mod_Ctrl, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Copy to clipboard"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Copy to clipboard"_string); return action; } NonnullRefPtr make_paste_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("&Paste", { Mod_Ctrl, Key_V }, Gfx::Bitmap::load_from_file("/res/icons/16x16/paste.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Paste from clipboard"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Paste from clipboard"_string); return action; } NonnullRefPtr make_insert_emoji_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("&Insert Emoji...", { Mod_Ctrl | Mod_Alt, Key_Space }, Gfx::Bitmap::load_from_file("/res/icons/16x16/emoji.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Open the Emoji Picker"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Open the Emoji Picker"_string); return action; } NonnullRefPtr make_fullscreen_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("&Fullscreen", { Mod_None, Key_F11 }, move(callback), parent); - action->set_status_tip("Enter fullscreen mode"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Enter fullscreen mode"_string); action->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/fullscreen.png"sv).release_value_but_fixme_should_propagate_errors()); return action; } @@ -121,28 +121,28 @@ NonnullRefPtr make_fullscreen_action(Function callback, C NonnullRefPtr make_quit_action(Function callback) { auto action = Action::create("&Quit", { Mod_Alt, Key_F4 }, move(callback)); - action->set_status_tip("Quit the application"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Quit the application"_string); return action; } NonnullRefPtr make_help_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("&Manual", { Mod_None, Key_F1 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Show help contents"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Show help contents"_string); return action; } NonnullRefPtr make_go_back_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("Go &Back", { Mod_Alt, Key_Left }, { MouseButton::Backward }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Move one step backward in history"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Move one step backward in history"_string); return action; } NonnullRefPtr make_go_forward_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("Go &Forward", { Mod_Alt, Key_Right }, { MouseButton::Forward }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Move one step forward in history"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Move one step forward in history"_string); return action; } @@ -154,7 +154,7 @@ NonnullRefPtr make_go_home_action(Function callback, Core NonnullRefPtr make_close_tab_action(Function callback, Core::EventReceiver* parent) { auto action = Action::create("&Close Tab", { Mod_Ctrl, Key_W }, Gfx::Bitmap::load_from_file("/res/icons/16x16/close-tab.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); - action->set_status_tip("Close current tab"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Close current tab"_string); return action; } @@ -214,7 +214,7 @@ NonnullRefPtr make_command_palette_action(Window* window) action->flash_menubar_menu(*window); action->activate(); }); - action->set_status_tip("Open the command palette"_string.release_value_but_fixme_should_propagate_errors()); + action->set_status_tip("Open the command palette"_string); return action; } diff --git a/Userland/Libraries/LibGUI/CommonMenus.cpp b/Userland/Libraries/LibGUI/CommonMenus.cpp index 1ec60c183ef..424c40ecbdc 100644 --- a/Userland/Libraries/LibGUI/CommonMenus.cpp +++ b/Userland/Libraries/LibGUI/CommonMenus.cpp @@ -59,7 +59,7 @@ ErrorOr> make_accessibility_menu(ColorFilterer& filterer) group->add_action(*achromatomaly_accessibility_action); (void)group.leak_ptr(); - auto menu = TRY(Menu::try_create(TRY("&Accessibility"_string))); + auto menu = TRY(Menu::try_create("&Accessibility"_string)); menu->add_action(default_accessibility_action); menu->add_action(pratanopia_accessibility_action); menu->add_action(pratanomaly_accessibility_action); diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index c03e42a3e6e..24366419c8e 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -778,11 +778,11 @@ ErrorOr FileSystemModel::column_name(int column) const case Column::Permissions: return "Mode"_short_string; case Column::ModificationTime: - return TRY("Modified"_string); + return "Modified"_string; case Column::Inode: return "Inode"_short_string; case Column::SymlinkTarget: - return TRY("Symlink target"_string); + return "Symlink target"_string; } VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibGUI/MessageBox.cpp b/Userland/Libraries/LibGUI/MessageBox.cpp index b761888aba6..f92d76fa06a 100644 --- a/Userland/Libraries/LibGUI/MessageBox.cpp +++ b/Userland/Libraries/LibGUI/MessageBox.cpp @@ -89,7 +89,7 @@ ErrorOr MessageBox::try_ask_about_unsaved_changes(Window* pa box->set_icon(parent_window->icon()); if (path.is_empty()) - box->m_yes_button->set_text(TRY("Save As..."_string)); + box->m_yes_button->set_text("Save As..."_string); else box->m_yes_button->set_text("Save"_short_string); box->m_no_button->set_text("Discard"_short_string); diff --git a/Userland/Libraries/LibGUI/SettingsWindow.cpp b/Userland/Libraries/LibGUI/SettingsWindow.cpp index a39b8db9e03..c6ba6cdf944 100644 --- a/Userland/Libraries/LibGUI/SettingsWindow.cpp +++ b/Userland/Libraries/LibGUI/SettingsWindow.cpp @@ -43,7 +43,7 @@ ErrorOr> SettingsWindow::create(DeprecatedString t TRY(button_container->try_set_layout(GUI::Margins {}, 6)); if (show_defaults_button == ShowDefaultsButton::Yes) { - window->m_reset_button = TRY(button_container->try_add(TRY("Defaults"_string))); + window->m_reset_button = TRY(button_container->try_add("Defaults"_string)); window->m_reset_button->on_click = [window = window->make_weak_ptr()](auto) { window->reset_default_values(); }; diff --git a/Userland/Libraries/LibGUI/Toolbar.cpp b/Userland/Libraries/LibGUI/Toolbar.cpp index 0e8d9280794..79f15222d9b 100644 --- a/Userland/Libraries/LibGUI/Toolbar.cpp +++ b/Userland/Libraries/LibGUI/Toolbar.cpp @@ -171,7 +171,7 @@ ErrorOr Toolbar::create_overflow_objects() m_overflow_action = Action::create("Overflow Menu", { Mod_Ctrl | Mod_Shift, Key_O }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/overflow-menu.png"sv)), [&](auto&) { m_overflow_menu->popup(m_overflow_button->screen_relative_rect().bottom_left().moved_up(1), {}, m_overflow_button->rect()); }); - m_overflow_action->set_status_tip(TRY("Show hidden toolbar actions"_string)); + m_overflow_action->set_status_tip("Show hidden toolbar actions"_string); m_overflow_action->set_enabled(false); TRY(add_spacer()); diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp index b747ce9b2ef..32c288632f4 100644 --- a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp @@ -300,7 +300,7 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Realm& realm, Execu for (size_t i = 0; i < registers().size(); ++i) { String value_string; if (registers()[i].is_empty()) - value_string = MUST("(empty)"_string); + value_string = "(empty)"_string; else value_string = MUST(registers()[i].to_string_without_side_effects()); dbgln("[{:3}] {}", i, value_string); diff --git a/Userland/Libraries/LibJS/Console.cpp b/Userland/Libraries/LibJS/Console.cpp index 8e6769209ee..9fdf5503b5b 100644 --- a/Userland/Libraries/LibJS/Console.cpp +++ b/Userland/Libraries/LibJS/Console.cpp @@ -142,7 +142,7 @@ ThrowCompletionOr Console::trace() for (ssize_t i = execution_context_stack.size() - 2; i >= 0; --i) { auto const& function_name = execution_context_stack[i]->function_name; trace.stack.append(function_name.is_empty() - ? TRY_OR_THROW_OOM(vm, ""_string) + ? ""_string : TRY_OR_THROW_OOM(vm, String::from_deprecated_string(function_name))); } @@ -259,8 +259,6 @@ ThrowCompletionOr Console::count_reset() // 1.3.1. group(...data), https://console.spec.whatwg.org/#group ThrowCompletionOr Console::group() { - auto& vm = realm().vm(); - // 1. Let group be a new group. Group group; @@ -273,7 +271,7 @@ ThrowCompletionOr Console::group() } // ... Otherwise, let groupLabel be an implementation-chosen label representing a group. else { - group_label = TRY_OR_THROW_OOM(vm, "Group"_string); + group_label = "Group"_string; } // 3. Incorporate groupLabel as a label for group. @@ -295,8 +293,6 @@ ThrowCompletionOr Console::group() // 1.3.2. groupCollapsed(...data), https://console.spec.whatwg.org/#groupcollapsed ThrowCompletionOr Console::group_collapsed() { - auto& vm = realm().vm(); - // 1. Let group be a new group. Group group; @@ -309,7 +305,7 @@ ThrowCompletionOr Console::group_collapsed() } // ... Otherwise, let groupLabel be an implementation-chosen label representing a group. else { - group_label = TRY_OR_THROW_OOM(vm, "Group"_string); + group_label = "Group"_string; } // 3. Incorporate groupLabel as a label for group. diff --git a/Userland/Libraries/LibJS/Lexer.cpp b/Userland/Libraries/LibJS/Lexer.cpp index acf79851055..ec4bf8359f2 100644 --- a/Userland/Libraries/LibJS/Lexer.cpp +++ b/Userland/Libraries/LibJS/Lexer.cpp @@ -831,7 +831,7 @@ Token Lexer::next() if (m_hit_invalid_unicode.has_value()) { value_start = m_hit_invalid_unicode.value() - 1; - m_current_token = Token(TokenType::Invalid, "Invalid unicode codepoint in source"_string.release_value_but_fixme_should_propagate_errors(), + m_current_token = Token(TokenType::Invalid, "Invalid unicode codepoint in source"_string, ""sv, // Since the invalid unicode can occur anywhere in the current token the trivia is not correct m_source.substring_view(value_start + 1, min(4u, m_source.length() - value_start - 2)), m_filename, diff --git a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp index 7a0bc6d12d2..235f6251197 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp @@ -47,7 +47,7 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::to_string) // 4. If name is undefined, set name to "Error"; otherwise set name to ? ToString(name). auto name = name_property.is_undefined() - ? TRY_OR_THROW_OOM(vm, "Error"_string) + ? "Error"_string : TRY(name_property.to_string(vm)); // 5. Let msg be ? Get(O, "message"). @@ -90,7 +90,7 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::stack_getter) if (auto name_property = TRY(error.get(vm.names.name)); !name_property.is_undefined()) name = TRY(name_property.to_string(vm)); else - name = TRY_OR_THROW_OOM(vm, "Error"_string); + name = "Error"_string; String message {}; if (auto message_property = TRY(error.get(vm.names.message)); !message_property.is_undefined()) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp index fb181cbc697..8c1143fefe1 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp @@ -463,7 +463,7 @@ ThrowCompletionOr resolve_locale(VM& vm, Vector const& req // 4. Else if keyLocaleData contains "true", then else if (key_locale_data.contains_slow("true"sv)) { // a. Let value be "true". - value = TRY_OR_THROW_OOM(vm, "true"_string); + value = "true"_string; // b. Let supportedExtensionAddition be the string-concatenation of "-" and key. supported_extension_addition = ::Locale::Keyword { TRY_OR_THROW_OOM(vm, String::from_utf8(key)), {} }; @@ -486,7 +486,7 @@ ThrowCompletionOr resolve_locale(VM& vm, Vector const& req // 3. If optionsValue is the empty String, then if (options_value->is_empty()) { // a. Let optionsValue be "true". - options_value = TRY_OR_THROW_OOM(vm, "true"_string); + options_value = "true"_string; } } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp index 3d890e7c798..269546c9933 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp @@ -83,7 +83,7 @@ static ThrowCompletionOr initialize_collator(VM& vm, Collator& collat // 21. Let collation be r.[[co]]. // 22. If collation is null, let collation be "default". // 23. Set collator.[[Collation]] to collation. - collator.set_collation(result.co.has_value() ? result.co.release_value() : TRY_OR_THROW_OOM(vm, "default"_string)); + collator.set_collation(result.co.has_value() ? result.co.release_value() : "default"_string); // 24. If relevantExtensionKeys contains "kn", then if (relevant_extension_keys.span().contains_slow("kn"sv) && result.kn.has_value()) { diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index 977b71b738f..2913aeaf01a 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -159,7 +159,7 @@ ThrowCompletionOr to_temporal_overflow(VM& vm, Object const* options) { // 1. If options is undefined, return "constrain". if (options == nullptr) - return TRY_OR_THROW_OOM(vm, "constrain"_string); + return "constrain"_string; // 2. Return ? GetOption(options, "overflow", "string", « "constrain", "reject" », "constrain"). auto option = TRY(get_option(vm, *options, vm.names.overflow, OptionType::String, { "constrain"sv, "reject"sv }, "constrain"sv)); @@ -173,7 +173,7 @@ ThrowCompletionOr to_temporal_disambiguation(VM& vm, Object const* optio { // 1. If options is undefined, return "compatible". if (options == nullptr) - return TRY_OR_THROW_OOM(vm, "compatible"_string); + return "compatible"_string; // 2. Return ? GetOption(options, "disambiguation", "string", « "compatible", "earlier", "later", "reject" », "compatible"). auto option = TRY(get_option(vm, *options, vm.names.disambiguation, OptionType::String, { "compatible"sv, "earlier"sv, "later"sv, "reject"sv }, "compatible"sv)); @@ -1425,7 +1425,7 @@ ThrowCompletionOr parse_temporal_instant_string(VM& vm, StringV // 4. If result.[[TimeZone]].[[Z]] is true, then if (result.time_zone.z) { // a. Set offsetString to "+00:00". - offset_string = TRY_OR_THROW_OOM(vm, "+00:00"_string); + offset_string = "+00:00"_string; } // 6. Assert: offsetString is not undefined. @@ -1460,7 +1460,7 @@ ThrowCompletionOr parse_temporal_calendar_string(VM& vm, StringView iso_ // b. If calendar is undefined, return "iso8601". if (!calendar.has_value()) - return TRY_OR_THROW_OOM(vm, "iso8601"_string); + return "iso8601"_string; // c. Else, return calendar. else return calendar.release_value(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp index c0513479246..9e43df158ec 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp @@ -99,7 +99,7 @@ ThrowCompletionOr get_builtin_calendar(VM& vm, String const& identifi Calendar* get_iso8601_calendar(VM& vm) { // 1. Return ! GetBuiltinCalendar("iso8601"). - return MUST(get_builtin_calendar(vm, "iso8601"_string.release_value_but_fixme_should_propagate_errors())); + return MUST(get_builtin_calendar(vm, "iso8601"_string)); } // 12.2.4 CalendarFields ( calendar, fieldNames ), https://tc39.es/proposal-temporal/#sec-temporal-calendarfields @@ -825,9 +825,9 @@ ThrowCompletionOr iso_date_from_fields(VM& vm, Object const& fiel // 2. Set fields to ? PrepareTemporalFields(fields, « "day", "month", "monthCode", "year" », « "year", "day" »). auto* prepared_fields = TRY(prepare_temporal_fields(vm, fields, { "day"_short_string, - TRY_OR_THROW_OOM(vm, "month"_string), - TRY_OR_THROW_OOM(vm, "monthCode"_string), - TRY_OR_THROW_OOM(vm, "year"_string) }, + "month"_string, + "monthCode"_string, + "year"_string }, Vector { "year"sv, "day"sv })); // 3. Let overflow be ? ToTemporalOverflow(options). @@ -859,9 +859,9 @@ ThrowCompletionOr iso_year_month_from_fields(VM& vm, Object const& // 2. Set fields to ? PrepareTemporalFields(fields, « "month", "monthCode", "year" », « "year" »). auto* prepared_fields = TRY(prepare_temporal_fields(vm, fields, - { TRY_OR_THROW_OOM(vm, "month"_string), - TRY_OR_THROW_OOM(vm, "monthCode"_string), - TRY_OR_THROW_OOM(vm, "year"_string) }, + { "month"_string, + "monthCode"_string, + "year"_string }, Vector { "year"sv })); // 3. Let overflow be ? ToTemporalOverflow(options). @@ -891,9 +891,9 @@ ThrowCompletionOr iso_month_day_from_fields(VM& vm, Object const& f // 2. Set fields to ? PrepareTemporalFields(fields, « "day", "month", "monthCode", "year" », « "day" »). auto* prepared_fields = TRY(prepare_temporal_fields(vm, fields, { "day"_short_string, - TRY_OR_THROW_OOM(vm, "month"_string), - TRY_OR_THROW_OOM(vm, "monthCode"_string), - TRY_OR_THROW_OOM(vm, "year"_string) }, + "month"_string, + "monthCode"_string, + "year"_string }, Vector { "day"sv })); // 3. Let overflow be ? ToTemporalOverflow(options). diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp index 28ff14ad6f8..c7b1d6a0771 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/DurationPrototype.cpp @@ -369,7 +369,7 @@ JS_DEFINE_NATIVE_FUNCTION(DurationPrototype::round) smallest_unit_present = false; // b. Set smallestUnit to "nanosecond". - smallest_unit = TRY_OR_THROW_OOM(vm, "nanosecond"_string); + smallest_unit = "nanosecond"_string; } // 10. Let defaultLargestUnit be ! DefaultTemporalLargestUnit(duration.[[Years]], duration.[[Months]], duration.[[Weeks]], duration.[[Days]], duration.[[Hours]], duration.[[Minutes]], duration.[[Seconds]], duration.[[Milliseconds]], duration.[[Microseconds]]). diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp index 52f8dbef304..e31da74d04e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp @@ -344,12 +344,12 @@ ThrowCompletionOr to_temporal_time_record(VM& vm, Object // 2. Let partial be ? PrepareTemporalFields(temporalTimeLike, « "hour", "microsecond", "millisecond", "minute", "nanosecond", "second" », partial). auto* partial = TRY(prepare_temporal_fields(vm, temporal_time_like, - { TRY_OR_THROW_OOM(vm, "hour"_string), - TRY_OR_THROW_OOM(vm, "microsecond"_string), - TRY_OR_THROW_OOM(vm, "millisecond"_string), - TRY_OR_THROW_OOM(vm, "minute"_string), - TRY_OR_THROW_OOM(vm, "nanosecond"_string), - TRY_OR_THROW_OOM(vm, "second"_string) }, + { "hour"_string, + "microsecond"_string, + "millisecond"_string, + "minute"_string, + "nanosecond"_string, + "second"_string }, PrepareTemporalFieldsPartial {})); TemporalTimeLikeRecord result; diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp index 0eaa50683c3..114dafcaf22 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp @@ -150,10 +150,10 @@ ThrowCompletionOr to_temporal_zoned_date_time(VM& vm, Value item auto field_names = TRY(calendar_fields(vm, *calendar, { "day"sv, "hour"sv, "microsecond"sv, "millisecond"sv, "minute"sv, "month"sv, "monthCode"sv, "nanosecond"sv, "second"sv, "year"sv })); // d. Append "timeZone" to fieldNames. - field_names.append(TRY_OR_THROW_OOM(vm, "timeZone"_string)); + field_names.append("timeZone"_string); // e. Append "offset" to fieldNames. - field_names.append(TRY_OR_THROW_OOM(vm, "offset"_string)); + field_names.append("offset"_string); // f. Let fields be ? PrepareTemporalFields(item, fieldNames, « "timeZone" »). auto* fields = TRY(prepare_temporal_fields(vm, item_object, field_names, Vector { "timeZone"sv })); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp index 4d4f2d5a9b1..6e6eb262b67 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTimePrototype.cpp @@ -769,7 +769,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::with) auto field_names = TRY(calendar_fields(vm, calendar, { "day"sv, "hour"sv, "microsecond"sv, "millisecond"sv, "minute"sv, "month"sv, "monthCode"sv, "nanosecond"sv, "second"sv, "year"sv })); // 7. Append "offset" to fieldNames. - field_names.append(TRY_OR_THROW_OOM(vm, "offset"_string)); + field_names.append("offset"_string); // 8. Let partialZonedDateTime be ? PrepareTemporalFields(temporalZonedDateTimeLike, fieldNames, partial). auto* partial_zoned_date_time = TRY(prepare_temporal_fields(vm, temporal_zoned_date_time_like.as_object(), field_names, PrepareTemporalFieldsPartial {})); @@ -787,7 +787,7 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::with) auto& time_zone = zoned_date_time->time_zone(); // 13. Append "timeZone" to fieldNames. - field_names.append(TRY_OR_THROW_OOM(vm, "timeZone"_string)); + field_names.append("timeZone"_string); // 14. Let fields be ? PrepareTemporalFields(zonedDateTime, fieldNames, « "timeZone", "offset" »). auto* fields = TRY(prepare_temporal_fields(vm, zoned_date_time, field_names, Vector { "timeZone"sv, "offset"sv })); diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index 16fa1416c5a..43b26dc6099 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -44,7 +44,7 @@ ErrorOr> VM::create(OwnPtr custom_data) WellKnownSymbols well_known_symbols { #define __JS_ENUMERATE(SymbolName, snake_name) \ - Symbol::create(*vm, TRY("Symbol." #SymbolName##_string), false), + Symbol::create(*vm, "Symbol." #SymbolName##_string, false), JS_ENUMERATE_WELL_KNOWN_SYMBOLS #undef __JS_ENUMERATE }; diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 0380ad36810..1817f622a63 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -420,14 +420,14 @@ ThrowCompletionOr Value::to_string(VM& vm) const return vm.throw_completion(ErrorType::Convert, "symbol", "string"); // 3. If argument is undefined, return "undefined". case UNDEFINED_TAG: - return TRY_OR_THROW_OOM(vm, "undefined"_string); + return "undefined"_string; // 4. If argument is null, return "null". case NULL_TAG: - return TRY_OR_THROW_OOM(vm, "null"_string); + return "null"_string; // 5. If argument is true, return "true". // 6. If argument is false, return "false". case BOOLEAN_TAG: - return TRY_OR_THROW_OOM(vm, as_bool() ? "true"_string : "false"_string); + return as_bool() ? "true"_string : "false"_string; // 7. If argument is a Number, return Number::toString(argument, 10). case INT32_TAG: return TRY_OR_THROW_OOM(vm, String::number(as_i32())); diff --git a/Userland/Libraries/LibManual/PageNode.cpp b/Userland/Libraries/LibManual/PageNode.cpp index f329ee7d39b..d6bdce65697 100644 --- a/Userland/Libraries/LibManual/PageNode.cpp +++ b/Userland/Libraries/LibManual/PageNode.cpp @@ -34,7 +34,7 @@ unsigned PageNode::section_number() const ErrorOr> PageNode::help_index_page() { - static NonnullRefPtr const help_index_page = TRY(try_make_ref_counted(sections[7 - 1], TRY("Help-index"_string))); + static NonnullRefPtr const help_index_page = TRY(try_make_ref_counted(sections[7 - 1], "Help-index"_string)); return help_index_page; } diff --git a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp index 5e93026bdd2..61097dd4898 100644 --- a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp @@ -466,7 +466,7 @@ WebIDL::ExceptionOr>> main_fetch(JS:: // - should internalResponse to request be blocked due to nosniff || TRY_OR_IGNORE(Infrastructure::should_response_to_request_be_blocked_due_to_nosniff(internal_response, request)) == Infrastructure::RequestOrResponseBlocking::Blocked)) { // then set response and internalResponse to a network error. - response = internal_response = Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("Response was blocked"_string)); + response = internal_response = Infrastructure::Response::network_error(vm, "Response was blocked"_string); } // 20. If response’s type is "opaque", internalResponse’s status is 206, internalResponse’s range-requested @@ -479,7 +479,7 @@ WebIDL::ExceptionOr>> main_fetch(JS:: && internal_response->status() == 206 && internal_response->range_requested() && !request->header_list()->contains("Range"sv.bytes())) { - response = internal_response = Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("Response has status 206 and 'range-requested' flag set, but request has no 'Range' header"_string)); + response = internal_response = Infrastructure::Response::network_error(vm, "Response has status 206 and 'range-requested' flag set, but request has no 'Range' header"_string); } // 21. If response is not a network error and either request’s method is `HEAD` or `CONNECT`, or @@ -834,8 +834,8 @@ WebIDL::ExceptionOr> scheme_fetch(JS::Realm& r // 4. Return a network error. auto message = request->current_url().scheme() == "about"sv - ? TRY_OR_THROW_OOM(vm, "Request has invalid 'about:' URL, only 'about:blank' can be fetched"_string) - : TRY_OR_THROW_OOM(vm, "Request URL has invalid scheme, must be one of 'about', 'blob', 'data', 'file', 'http', or 'https'"_string); + ? "Request has invalid 'about:' URL, only 'about:blank' can be fetched"_string + : "Request URL has invalid scheme, must be one of 'about', 'blob', 'data', 'file', 'http', or 'https'"_string; return PendingResponse::create(vm, request, Infrastructure::Response::network_error(vm, move(message))); } @@ -983,7 +983,7 @@ WebIDL::ExceptionOr> http_fetch(JS::Realm& rea // a service worker for that matter, it is applied here. if (request->response_tainting() == Infrastructure::Request::ResponseTainting::CORS && !TRY_OR_IGNORE(cors_check(request, *response))) { - returned_pending_response->resolve(Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("Request with 'cors' response tainting failed CORS check"_string))); + returned_pending_response->resolve(Infrastructure::Response::network_error(vm, "Request with 'cors' response tainting failed CORS check"_string)); return; } @@ -1001,7 +1001,7 @@ WebIDL::ExceptionOr> http_fetch(JS::Realm& rea if ((request->response_tainting() == Infrastructure::Request::ResponseTainting::Opaque || response->type() == Infrastructure::Response::Type::Opaque) && false // FIXME: "and the cross-origin resource policy check with request’s origin, request’s client, request’s destination, and actualResponse returns blocked" ) { - returned_pending_response->resolve(Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("Response was blocked by cross-origin resource policy check"_string))); + returned_pending_response->resolve(Infrastructure::Response::network_error(vm, "Response was blocked by cross-origin resource policy check"_string)); return; } @@ -1018,7 +1018,7 @@ WebIDL::ExceptionOr> http_fetch(JS::Realm& rea // -> "error" case Infrastructure::Request::RedirectMode::Error: // Set response to a network error. - response = Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("Request with 'error' redirect mode received redirect response"_string)); + response = Infrastructure::Response::network_error(vm, "Request with 'error' redirect mode received redirect response"_string); break; // -> "manual" case Infrastructure::Request::RedirectMode::Manual: @@ -1583,7 +1583,7 @@ WebIDL::ExceptionOr> http_network_or_cache_fet if (!request->body().has()) { // 1. If request’s body’s source is null, then return a network error. if (request->body().get().source().has()) { - returned_pending_response->resolve(Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("Request has body but no body source"_string))); + returned_pending_response->resolve(Infrastructure::Response::network_error(vm, "Request has body but no body source"_string)); return; } @@ -1629,7 +1629,7 @@ WebIDL::ExceptionOr> http_network_or_cache_fet // 1. If request’s window is "no-window", then return a network error. if (request->window().has() && request->window().get() == Infrastructure::Request::Window::NoWindow) { - returned_pending_response->resolve(Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("Request requires proxy authentication but has 'no-window' set"_string))); + returned_pending_response->resolve(Infrastructure::Response::network_error(vm, "Request requires proxy authentication but has 'no-window' set"_string)); return; } @@ -1783,7 +1783,7 @@ WebIDL::ExceptionOr> nonstandard_resource_load auto response = Infrastructure::Response::create(vm); // FIXME: This is ugly, ResourceLoader should tell us. if (status_code.value_or(0) == 0) { - response = Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("HTTP request failed"_string)); + response = Infrastructure::Response::network_error(vm, "HTTP request failed"_string); } else { response->set_type(Infrastructure::Response::Type::Error); response->set_status(status_code.value_or(400)); @@ -1874,12 +1874,12 @@ WebIDL::ExceptionOr> cors_preflight_fetch(JS:: // 3. If either methods or headerNames is failure, return a network error. if (methods_or_failure.has()) { - returned_pending_response->resolve(Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("The Access-Control-Allow-Methods in the CORS-preflight response is syntactically invalid"_string))); + returned_pending_response->resolve(Infrastructure::Response::network_error(vm, "The Access-Control-Allow-Methods in the CORS-preflight response is syntactically invalid"_string)); return; } if (header_names_or_failure.has()) { - returned_pending_response->resolve(Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("The Access-Control-Allow-Headers in the CORS-preflight response is syntactically invalid"_string))); + returned_pending_response->resolve(Infrastructure::Response::network_error(vm, "The Access-Control-Allow-Headers in the CORS-preflight response is syntactically invalid"_string)); return; } @@ -1976,7 +1976,7 @@ WebIDL::ExceptionOr> cors_preflight_fetch(JS:: } // 8. Otherwise, return a network error. - returned_pending_response->resolve(Infrastructure::Response::network_error(vm, TRY_OR_IGNORE("CORS-preflight check failed"_string))); + returned_pending_response->resolve(Infrastructure::Response::network_error(vm, "CORS-preflight check failed"_string)); }); return returned_pending_response; diff --git a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp index ffbc12f0fa6..f5741fc2b12 100644 --- a/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Infrastructure/HTTP/Headers.cpp @@ -401,7 +401,7 @@ ErrorOr> HeaderList::extract_mime_type() const } // 5. Otherwise, if mimeType’s parameters["charset"] does not exist, and charset is non-null, set mimeType’s parameters["charset"] to charset. else if (!mime_type->parameters().contains("charset"sv) && charset.has_value()) { - TRY(mime_type->set_parameter(TRY("charset"_string), charset.release_value())); + TRY(mime_type->set_parameter("charset"_string, charset.release_value())); } } diff --git a/Userland/Libraries/LibWeb/Fetch/Request.cpp b/Userland/Libraries/LibWeb/Fetch/Request.cpp index 6119156c9ff..9373743f5c0 100644 --- a/Userland/Libraries/LibWeb/Fetch/Request.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Request.cpp @@ -543,7 +543,7 @@ WebIDL::ExceptionOr Request::referrer() const return String {}; // 2. If this’s request’s referrer is "client", then return "about:client". case Infrastructure::Request::Referrer::Client: - return TRY_OR_THROW_OOM(vm, "about:client"_string); + return "about:client"_string; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp index 193b9936b74..39622a30c15 100644 --- a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp +++ b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp @@ -226,10 +226,10 @@ JS::ThrowCompletionOr CustomElementRegistry::define(String const& name, We disabled_features = TRY(convert_value_to_sequence_of_strings(vm, disabled_features_iterable)); // 9. Set disableInternals to true if disabledFeatures contains "internals". - disable_internals = disabled_features.contains_slow(TRY_OR_THROW_OOM(vm, "internals"_string)); + disable_internals = disabled_features.contains_slow("internals"_string); // 10. Set disableShadow to true if disabledFeatures contains "shadow". - disable_shadow = disabled_features.contains_slow(TRY_OR_THROW_OOM(vm, "shadow"_string)); + disable_shadow = disabled_features.contains_slow("shadow"_string); // 11. Let formAssociatedValue be ? Get( constructor, "formAssociated"). auto form_associated_value = TRY(constructor->callback->get(JS::PropertyKey { "formAssociated" })); diff --git a/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp b/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp index 265d0a3a018..7f4eb2763a1 100644 --- a/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp +++ b/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp @@ -37,7 +37,7 @@ WebIDL::ExceptionOr create_entry(JS::Realm& realm, String co if (filename.has_value()) name_attribute = filename.value(); else - name_attribute = TRY_OR_THROW_OOM(vm, "blob"_string); + name_attribute = "blob"_string; return JS::make_handle(TRY(FileAPI::File::create(realm, { JS::make_handle(*blob) }, move(name_attribute), {}))); })); @@ -136,7 +136,7 @@ WebIDL::ExceptionOr>> construct_entry_list(J // 1. If there are no selected files, then create an entry with name and a new File object with an empty name, application/octet-stream as type, and an empty body, and append it to entry list. if (file_element->files()->length() == 0) { FileAPI::FilePropertyBag options {}; - options.type = TRY_OR_THROW_OOM(vm, "application/octet-stream"_string); + options.type = "application/octet-stream"_string; auto file = TRY(FileAPI::File::create(realm, {}, String {}, options)); TRY_OR_THROW_OOM(vm, entry_list.try_append(XHR::FormDataEntry { .name = move(name), .value = JS::make_handle(file) })); } @@ -151,7 +151,7 @@ WebIDL::ExceptionOr>> construct_entry_list(J // 9. Otherwise, if the field element is an input element whose type attribute is in the Hidden state and name is an ASCII case-insensitive match for "_charset_": else if (auto* hidden_input = dynamic_cast(control.ptr()); hidden_input && hidden_input->type_state() == HTMLInputElement::TypeAttributeState::Hidden && Infra::is_ascii_case_insensitive_match(name, "_charset_"sv)) { // 1. Let charset be the name of encoding if encoding is given, and "UTF-8" otherwise. - auto charset = encoding.has_value() ? encoding.value() : TRY_OR_THROW_OOM(vm, "UTF-8"_string); + auto charset = encoding.has_value() ? encoding.value() : "UTF-8"_string; // 2. Create an entry with name and charset, and append it to entry list. TRY_OR_THROW_OOM(vm, entry_list.try_append(XHR::FormDataEntry { .name = move(name), .value = move(charset) })); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index b12f2e47f47..e402619dad2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -829,7 +829,7 @@ WebIDL::ExceptionOr HTMLMediaElement::select_resource() // 1. ⌛ If the src attribute's value is the empty string, then end the synchronous section, and jump down to the failed with attribute step below. auto source = attribute(HTML::AttributeNames::src); if (source.is_empty()) { - failed_with_attribute(TRY_OR_THROW_OOM(vm, "The 'src' attribute is empty"_string)); + failed_with_attribute("The 'src' attribute is empty"_string); return {}; } @@ -850,7 +850,7 @@ WebIDL::ExceptionOr HTMLMediaElement::select_resource() return {}; } - failed_with_attribute(TRY_OR_THROW_OOM(vm, "Failed to parse 'src' attribute as a URL"_string)); + failed_with_attribute("Failed to parse 'src' attribute as a URL"_string); // 8. Return. The element won't attempt to load another resource until this algorithm is triggered again. return {}; diff --git a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp index 43621dac973..8e06e81fa4c 100644 --- a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp @@ -98,7 +98,7 @@ void MessagePort::post_message(JS::Value message) main_thread_event_loop().task_queue().add(HTML::Task::create(HTML::Task::Source::PostedMessage, nullptr, [target_port, message] { MessageEventInit event_init {}; event_init.data = message; - event_init.origin = ""_string.release_value_but_fixme_should_propagate_errors(); + event_init.origin = ""_string; target_port->dispatch_event(MessageEvent::create(target_port->realm(), HTML::EventNames::message, event_init).release_value_but_fixme_should_propagate_errors()); })); } diff --git a/Userland/Libraries/LibWeb/HTML/MimeType.cpp b/Userland/Libraries/LibWeb/HTML/MimeType.cpp index e99231197e6..ab64991890f 100644 --- a/Userland/Libraries/LibWeb/HTML/MimeType.cpp +++ b/Userland/Libraries/LibWeb/HTML/MimeType.cpp @@ -35,10 +35,10 @@ String const& MimeType::type() const } // https://html.spec.whatwg.org/multipage/system-state.html#dom-mimetype-description -JS::ThrowCompletionOr MimeType::description() const +String MimeType::description() const { // The MimeType interface's description getter steps are to return "Portable Document Format". - static String description_string = TRY_OR_THROW_OOM(vm(), "Portable Document Format"_string); + static String description_string = "Portable Document Format"_string; return description_string; } diff --git a/Userland/Libraries/LibWeb/HTML/MimeType.h b/Userland/Libraries/LibWeb/HTML/MimeType.h index 29dd08a7f86..a97bf32410d 100644 --- a/Userland/Libraries/LibWeb/HTML/MimeType.h +++ b/Userland/Libraries/LibWeb/HTML/MimeType.h @@ -18,7 +18,7 @@ public: virtual ~MimeType() override; String const& type() const; - JS::ThrowCompletionOr description() const; + String description() const; String const& suffixes() const; JS::NonnullGCPtr enabled_plugin() const; diff --git a/Userland/Libraries/LibWeb/HTML/Plugin.cpp b/Userland/Libraries/LibWeb/HTML/Plugin.cpp index d8c30c41f0b..1c0446b3222 100644 --- a/Userland/Libraries/LibWeb/HTML/Plugin.cpp +++ b/Userland/Libraries/LibWeb/HTML/Plugin.cpp @@ -36,18 +36,18 @@ String const& Plugin::name() const } // https://html.spec.whatwg.org/multipage/system-state.html#dom-plugin-description -JS::ThrowCompletionOr Plugin::description() const +String Plugin::description() const { // The Plugin interface's description getter steps are to return "Portable Document Format". - static String description_string = TRY_OR_THROW_OOM(vm(), "Portable Document Format"_string); + static String description_string = "Portable Document Format"_string; return description_string; } // https://html.spec.whatwg.org/multipage/system-state.html#dom-plugin-filename -JS::ThrowCompletionOr Plugin::filename() const +String Plugin::filename() const { // The Plugin interface's filename getter steps are to return "internal-pdf-viewer". - static String filename_string = TRY_OR_THROW_OOM(vm(), "internal-pdf-viewer"_string); + static String filename_string = "internal-pdf-viewer"_string; return filename_string; } diff --git a/Userland/Libraries/LibWeb/HTML/Plugin.h b/Userland/Libraries/LibWeb/HTML/Plugin.h index 8b145ab4a0b..ba768589ee1 100644 --- a/Userland/Libraries/LibWeb/HTML/Plugin.h +++ b/Userland/Libraries/LibWeb/HTML/Plugin.h @@ -18,8 +18,8 @@ public: virtual ~Plugin() override; String const& name() const; - JS::ThrowCompletionOr description() const; - JS::ThrowCompletionOr filename() const; + String description() const; + String filename() const; size_t length() const; JS::GCPtr item(u32 index) const; JS::GCPtr named_item(String const& name) const; diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index 37730c4e3db..c4625f2935d 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -730,11 +730,11 @@ Vector> Window::pdf_viewer_plugin_objects() if (m_pdf_viewer_plugin_objects.is_empty()) { // FIXME: Propagate errors. - m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "PDF Viewer"_string.release_value_but_fixme_should_propagate_errors()).release_allocated_value_but_fixme_should_propagate_errors()); - m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "Chrome PDF Viewer"_string.release_value_but_fixme_should_propagate_errors()).release_allocated_value_but_fixme_should_propagate_errors()); - m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "Chromium PDF Viewer"_string.release_value_but_fixme_should_propagate_errors()).release_allocated_value_but_fixme_should_propagate_errors()); - m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "Microsoft Edge PDF Viewer"_string.release_value_but_fixme_should_propagate_errors()).release_allocated_value_but_fixme_should_propagate_errors()); - m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "WebKit built-in PDF"_string.release_value_but_fixme_should_propagate_errors()).release_allocated_value_but_fixme_should_propagate_errors()); + m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "PDF Viewer"_string).release_allocated_value_but_fixme_should_propagate_errors()); + m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "Chrome PDF Viewer"_string).release_allocated_value_but_fixme_should_propagate_errors()); + m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "Chromium PDF Viewer"_string).release_allocated_value_but_fixme_should_propagate_errors()); + m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "Microsoft Edge PDF Viewer"_string).release_allocated_value_but_fixme_should_propagate_errors()); + m_pdf_viewer_plugin_objects.append(realm().heap().allocate(realm(), realm(), "WebKit built-in PDF"_string).release_allocated_value_but_fixme_should_propagate_errors()); } return m_pdf_viewer_plugin_objects; @@ -753,8 +753,8 @@ Vector> Window::pdf_viewer_mime_type_objects() return {}; if (m_pdf_viewer_mime_type_objects.is_empty()) { - m_pdf_viewer_mime_type_objects.append(realm().heap().allocate(realm(), realm(), "application/pdf"_string.release_value_but_fixme_should_propagate_errors()).release_allocated_value_but_fixme_should_propagate_errors()); - m_pdf_viewer_mime_type_objects.append(realm().heap().allocate(realm(), realm(), "text/pdf"_string.release_value_but_fixme_should_propagate_errors()).release_allocated_value_but_fixme_should_propagate_errors()); + m_pdf_viewer_mime_type_objects.append(realm().heap().allocate(realm(), realm(), "application/pdf"_string).release_allocated_value_but_fixme_should_propagate_errors()); + m_pdf_viewer_mime_type_objects.append(realm().heap().allocate(realm(), realm(), "text/pdf"_string).release_allocated_value_but_fixme_should_propagate_errors()); } return m_pdf_viewer_mime_type_objects; @@ -1042,7 +1042,7 @@ void Window::post_message(JS::Value message, String const&) queue_global_task(Task::Source::PostedMessage, *this, [this, message] { MessageEventInit event_init {}; event_init.data = message; - event_init.origin = ""_string.release_value_but_fixme_should_propagate_errors(); + event_init.origin = ""_string; dispatch_event(MessageEvent::create(realm(), EventNames::message, event_init).release_value_but_fixme_should_propagate_errors()); }); } diff --git a/Userland/Libraries/LibWeb/HTML/Worker.cpp b/Userland/Libraries/LibWeb/HTML/Worker.cpp index c7b39db4776..23b51fb04cf 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.cpp +++ b/Userland/Libraries/LibWeb/HTML/Worker.cpp @@ -169,7 +169,7 @@ void Worker::run_a_worker(AK::URL& url, EnvironmentSettingsObject& outside_setti event_loop.task_queue().add(HTML::Task::create(HTML::Task::Source::PostedMessage, nullptr, [this, message] { MessageEventInit event_init {}; event_init.data = message; - event_init.origin = ""_string.release_value_but_fixme_should_propagate_errors(); + event_init.origin = ""_string; dispatch_event(MessageEvent::create(*m_worker_realm, HTML::EventNames::message, event_init).release_value_but_fixme_should_propagate_errors()); })); diff --git a/Userland/Libraries/LibWeb/HTML/Worker.h b/Userland/Libraries/LibWeb/HTML/Worker.h index 1395523edfb..9cf9723714f 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.h +++ b/Userland/Libraries/LibWeb/HTML/Worker.h @@ -26,8 +26,8 @@ namespace Web::HTML { struct WorkerOptions { - String type { "classic"_string.release_value_but_fixme_should_propagate_errors() }; - String credentials { "same-origin"_string.release_value_but_fixme_should_propagate_errors() }; + String type { "classic"_string }; + String credentials { "same-origin"_string }; String name { String {} }; }; diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp index c5fe7bc4387..0d0d465d6bb 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp @@ -221,7 +221,7 @@ static ErrorOr get_event_key(KeyCode platform_key, u32 code_point) // 5. Return key as the key attribute value for this key event. if (key.has_value()) return key.release_value(); - return TRY("Unidentified"_string); + return "Unidentified"_string; } // 3. Keyboard Event code Value Tables, https://www.w3.org/TR/uievents-code/#code-value-tables diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h index 6cd788b425a..fc35ead49bc 100644 --- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h +++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h @@ -75,7 +75,7 @@ private: ErrorOr establish_web_socket_connection(AK::URL& url_record, Vector& protocols, HTML::EnvironmentSettingsObject& client); AK::URL m_url; - String m_binary_type { "blob"_string.release_value_but_fixme_should_propagate_errors() }; + String m_binary_type { "blob"_string }; RefPtr m_websocket; }; diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 933679798d6..41a8b50eabf 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -267,7 +267,7 @@ ErrorOr XMLHttpRequest::get_response_mime_type() const // 2. If mimeType is failure, then set mimeType to text/xml. if (!mime_type.has_value()) - return MimeSniff::MimeType::create(TRY("text"_string), "xml"_short_string); + return MimeSniff::MimeType::create("text"_string, "xml"_short_string); // 3. Return mimeType. return mime_type.release_value(); @@ -498,7 +498,7 @@ WebIDL::ExceptionOr XMLHttpRequest::send(Optionalparameters().find("charset"sv); if (charset_parameter_iterator != content_type_record->parameters().end() && !Infra::is_ascii_case_insensitive_match(charset_parameter_iterator->value, "UTF-8"sv)) { // 1. Set contentTypeRecord’s parameters["charset"] to "UTF-8". - TRY_OR_THROW_OOM(vm, content_type_record->set_parameter(TRY_OR_THROW_OOM(vm, "charset"_string), TRY_OR_THROW_OOM(vm, "UTF-8"_string))); + TRY_OR_THROW_OOM(vm, content_type_record->set_parameter("charset"_string, "UTF-8"_string)); // 2. Let newContentTypeSerialized be the result of serializing contentTypeRecord. auto new_content_type_serialized = TRY_OR_THROW_OOM(vm, content_type_record->serialized()); @@ -925,7 +925,7 @@ WebIDL::ExceptionOr XMLHttpRequest::override_mime_type(String const& mime) // 3. If this’s override MIME type is failure, then set this’s override MIME type to application/octet-stream. if (!m_override_mime_type.has_value()) - m_override_mime_type = TRY_OR_THROW_OOM(vm, MimeSniff::MimeType::create(TRY_OR_THROW_OOM(vm, "application"_string), TRY_OR_THROW_OOM(vm, "octet-stream"_string))); + m_override_mime_type = TRY_OR_THROW_OOM(vm, MimeSniff::MimeType::create("application"_string, "octet-stream"_string)); return {}; } diff --git a/Userland/Services/ChessEngine/ChessEngine.cpp b/Userland/Services/ChessEngine/ChessEngine.cpp index e415e1b55e9..85ebb4cdd69 100644 --- a/Userland/Services/ChessEngine/ChessEngine.cpp +++ b/Userland/Services/ChessEngine/ChessEngine.cpp @@ -13,8 +13,8 @@ using namespace Chess::UCI; void ChessEngine::handle_uci() { - send_command(IdCommand(IdCommand::Type::Name, "ChessEngine"_string.release_value_but_fixme_should_propagate_errors())); - send_command(IdCommand(IdCommand::Type::Author, "the SerenityOS developers"_string.release_value_but_fixme_should_propagate_errors())); + send_command(IdCommand(IdCommand::Type::Name, "ChessEngine"_string)); + send_command(IdCommand(IdCommand::Type::Author, "the SerenityOS developers"_string)); send_command(UCIOkCommand()); } diff --git a/Userland/Services/Taskbar/ShutdownDialog.cpp b/Userland/Services/Taskbar/ShutdownDialog.cpp index 9a0efbf1d63..edfb6cdefc5 100644 --- a/Userland/Services/Taskbar/ShutdownDialog.cpp +++ b/Userland/Services/Taskbar/ShutdownDialog.cpp @@ -65,7 +65,7 @@ ShutdownDialog::ShutdownDialog() auto& right_container = content_container.add(); right_container.set_layout(GUI::Margins { 12, 12, 8, 0 }); - auto& label = right_container.add("What would you like to do?"_string.release_value_but_fixme_should_propagate_errors()); + auto& label = right_container.add("What would you like to do?"_string); label.set_text_alignment(Gfx::TextAlignment::CenterLeft); label.set_fixed_height(22); label.set_font(Gfx::FontDatabase::default_font().bold_variant()); diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp index 8412c37eaa8..187412b7e54 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.cpp +++ b/Userland/Services/Taskbar/TaskbarWindow.cpp @@ -110,7 +110,7 @@ void TaskbarWindow::add_system_menu(NonnullRefPtr system_menu) { m_system_menu = move(system_menu); - m_start_button = GUI::Button::construct("Serenity"_string.release_value_but_fixme_should_propagate_errors()); + m_start_button = GUI::Button::construct("Serenity"_string); set_start_button_font(Gfx::FontDatabase::default_font().bold_variant()); m_start_button->set_icon_spacing(0); auto app_icon = GUI::Icon::default_icon("ladyball"sv); diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp index 8f6cfb12fe2..901b3cd322a 100644 --- a/Userland/Services/WebServer/Client.cpp +++ b/Userland/Services/WebServer/Client.cpp @@ -116,7 +116,7 @@ ErrorOr Client::handle_request(HTTP::HttpRequest const& request) if (Configuration::the().credentials().has_value()) { bool has_authenticated = verify_credentials(request.headers()); if (!has_authenticated) { - auto const basic_auth_header = TRY("WWW-Authenticate: Basic realm=\"WebServer\", charset=\"UTF-8\""_string); + auto const basic_auth_header = "WWW-Authenticate: Basic realm=\"WebServer\", charset=\"UTF-8\""_string; Vector headers {}; TRY(headers.try_append(basic_auth_header)); TRY(send_error_response(401, request, move(headers))); @@ -325,7 +325,7 @@ ErrorOr Client::handle_directory_listing(String const& requested_path, Str auto response = builder.to_deprecated_string(); FixedMemoryStream stream { response.bytes() }; - return send_response(stream, request, { .type = TRY("text/html"_string), .length = response.length() }); + return send_response(stream, request, { .type = "text/html"_string, .length = response.length() }); } ErrorOr Client::send_error_response(unsigned code, HTTP::HttpRequest const& request, Vector const& headers) diff --git a/Userland/Services/WebServer/main.cpp b/Userland/Services/WebServer/main.cpp index f3e1971f175..6edc5be8150 100644 --- a/Userland/Services/WebServer/main.cpp +++ b/Userland/Services/WebServer/main.cpp @@ -22,9 +22,9 @@ ErrorOr serenity_main(Main::Arguments arguments) { - static auto const default_listen_address = TRY("0.0.0.0"_string); + static auto const default_listen_address = "0.0.0.0"_string; static auto const default_port = 8000; - static auto const default_document_root_path = TRY("/www"_string); + static auto const default_document_root_path = "/www"_string; DeprecatedString listen_address = default_listen_address.to_deprecated_string(); int port = default_port; diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index 8b86e07abcc..d94d2bf4fd9 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -708,7 +708,7 @@ void Window::request_update(Gfx::IntRect const& rect, bool ignore_occlusion) void Window::ensure_window_menu() { if (!m_window_menu) { - m_window_menu = Menu::construct(nullptr, -1, "(Window Menu)"_string.release_value_but_fixme_should_propagate_errors()); + m_window_menu = Menu::construct(nullptr, -1, "(Window Menu)"_string); m_window_menu->set_window_menu_of(*this); auto minimize_item = make(*m_window_menu, (unsigned)WindowMenuAction::MinimizeOrUnminimize, ""); diff --git a/Userland/Shell/Builtin.cpp b/Userland/Shell/Builtin.cpp index 2cc493e6fb7..2233d90e5dc 100644 --- a/Userland/Shell/Builtin.cpp +++ b/Userland/Shell/Builtin.cpp @@ -1418,7 +1418,7 @@ ErrorOr Shell::builtin_argsparser_parse(Main::Arguments arguments) auto try_convert = [](StringView value, Type type) -> ErrorOr>> { switch (type) { case Type::Bool: - return AST::make_ref_counted(TRY("true"_string)); + return AST::make_ref_counted("true"_string); case Type::String: return AST::make_ref_counted(TRY(String::from_utf8(value))); case Type::I32: @@ -1602,7 +1602,7 @@ ErrorOr Shell::builtin_argsparser_parse(Main::Arguments arguments) if (type == Type::Bool) { set_local_variable( current_variable, - make_ref_counted(MUST("false"_string)), + make_ref_counted("false"_string), true); } return true; diff --git a/Userland/Shell/ImmediateFunctions.cpp b/Userland/Shell/ImmediateFunctions.cpp index a48956267ba..b17a6e8bd30 100644 --- a/Userland/Shell/ImmediateFunctions.cpp +++ b/Userland/Shell/ImmediateFunctions.cpp @@ -81,7 +81,7 @@ ErrorOr> Shell::immediate_length_impl(AST::ImmediateExpression // ImmediateExpression(length ) resulting_nodes.unchecked_append(AST::make_ref_counted( expr_node->position(), - AST::NameWithPosition { TRY("length"_string), invoking_node.function_position() }, + AST::NameWithPosition { "length"_string, invoking_node.function_position() }, Vector> { Vector> { static_cast>(AST::make_ref_counted(expr_node->position(), TRY(String::from_utf8(mode_name)))), AST::make_ref_counted(expr_node->position(), NonnullRefPtr(entry)), @@ -825,7 +825,7 @@ ErrorOr parse_assignment_expression(Span& tokens) if (auto op = token.get_pointer(); op && is_assignment_operator(*op)) { if (!lhs.value.has()) { return Node { - make(TRY("Left-hand side of assignment must be a variable"_string)) + make("Left-hand side of assignment must be a variable"_string) }; } @@ -851,7 +851,7 @@ ErrorOr parse_ternary_expression(Span& tokens) if (!next_token_is_operator(tokens, Operator::TernaryColon)) { return Node { - make(TRY("Expected ':' after true value in ternary expression"_string)) + make("Expected ':' after true value in ternary expression"_string) }; } @@ -932,7 +932,7 @@ ErrorOr parse_unary_expression(Span& tokens) { if (tokens.is_empty()) { return Node { - make(TRY("Expected expression, got end of input"_string)) + make("Expected expression, got end of input"_string) }; } @@ -953,7 +953,7 @@ ErrorOr parse_unary_expression(Span& tokens) ErrorOr parse_primary_expression(Span& tokens) { if (tokens.is_empty()) - return Node { make(TRY("Expected expression, got end of input"_string)) }; + return Node { make("Expected expression, got end of input"_string) }; auto& token = tokens.first(); return token.visit( @@ -972,7 +972,7 @@ ErrorOr parse_primary_expression(Span& tokens) auto value = TRY(parse_expression(tokens)); if (!next_token_is_operator(tokens, Operator::CloseParen)) { return Node { - make(TRY("Expected ')' after expression in parentheses"_string)) + make("Expected ')' after expression in parentheses"_string) }; } tokens = tokens.slice(1); @@ -980,7 +980,7 @@ ErrorOr parse_primary_expression(Span& tokens) } default: return Node { - make(TRY("Expected expression, got operator"_string)) + make("Expected expression, got operator"_string) }; } }); diff --git a/Userland/Shell/Parser.cpp b/Userland/Shell/Parser.cpp index 44d92a4c73f..a8c14f06ab2 100644 --- a/Userland/Shell/Parser.cpp +++ b/Userland/Shell/Parser.cpp @@ -174,7 +174,7 @@ RefPtr Parser::parse() auto error_start = push_start(); while (!at_end()) consume(); - auto syntax_error_node = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Unexpected tokens past the end"_string)); + auto syntax_error_node = create("Unexpected tokens past the end"_string); if (!toplevel) toplevel = move(syntax_error_node); else if (!toplevel->is_syntax_error()) @@ -368,7 +368,7 @@ RefPtr Parser::parse_variable_decls() if (!command) restore_to(*start); else if (!expect(')')) - command->set_is_syntax_error(*create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a terminating close paren"_string), true)); + command->set_is_syntax_error(*create("Expected a terminating close paren"_string, true)); expression = command; } } @@ -442,7 +442,7 @@ RefPtr Parser::parse_function_decl() RefPtr syntax_error; { auto obrace_error_start = push_start(); - syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an open brace '{' to start a function body"_string), true); + syntax_error = create("Expected an open brace '{' to start a function body"_string, true); } if (!expect('{')) { return create( @@ -461,7 +461,7 @@ RefPtr Parser::parse_function_decl() RefPtr syntax_error; { auto cbrace_error_start = push_start(); - syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close brace '}' to end a function body"_string), true); + syntax_error = create("Expected a close brace '}' to end a function body"_string, true); } if (!expect('}')) { if (body) @@ -502,7 +502,7 @@ RefPtr Parser::parse_or_logical_sequence() auto right_and_sequence = parse_and_logical_sequence(); if (!right_and_sequence) - right_and_sequence = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an expression after '||'"_string), true); + right_and_sequence = create("Expected an expression after '||'"_string, true); return create( and_sequence.release_nonnull(), @@ -526,7 +526,7 @@ RefPtr Parser::parse_and_logical_sequence() auto right_and_sequence = parse_and_logical_sequence(); if (!right_and_sequence) - right_and_sequence = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an expression after '&&'"_string), true); + right_and_sequence = create("Expected an expression after '&&'"_string, true); return create( pipe_sequence.release_nonnull(), @@ -708,7 +708,7 @@ RefPtr Parser::parse_for_loop() consume_while(is_whitespace); auto in_error_start = push_start(); if (!expect("in"sv)) { - auto syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected 'in' after a variable name in a 'for' loop"_string), true); + auto syntax_error = create("Expected 'in' after a variable name in a 'for' loop"_string, true); return create(move(variable_name), move(index_variable_name), move(syntax_error), nullptr); // ForLoop Var Iterated Block } in_start_position = AST::Position { in_error_start->offset, m_offset, in_error_start->line, line() }; @@ -720,14 +720,14 @@ RefPtr Parser::parse_for_loop() auto iter_error_start = push_start(); iterated_expression = parse_expression(); if (!iterated_expression) - iterated_expression = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an expression in 'for' loop"_string), true); + iterated_expression = create("Expected an expression in 'for' loop"_string, true); } consume_while(is_any_of(" \t\n"sv)); { auto obrace_error_start = push_start(); if (!expect('{')) { - auto syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an open brace '{' to start a 'for' loop body"_string), true); + auto syntax_error = create("Expected an open brace '{' to start a 'for' loop body"_string, true); return create(move(variable_name), move(index_variable_name), move(iterated_expression), move(syntax_error), move(in_start_position), move(index_start_position)); // ForLoop Var Iterated Block } } @@ -739,7 +739,7 @@ RefPtr Parser::parse_for_loop() auto cbrace_error_start = push_start(); if (!expect('}')) { auto error_start = push_start(); - auto syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close brace '}' to end a 'for' loop body"_string), true); + auto syntax_error = create("Expected a close brace '}' to end a 'for' loop body"_string, true); if (body) body->set_is_syntax_error(*syntax_error); else @@ -764,7 +764,7 @@ RefPtr Parser::parse_loop_loop() { auto obrace_error_start = push_start(); if (!expect('{')) { - auto syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an open brace '{' to start a 'loop' loop body"_string), true); + auto syntax_error = create("Expected an open brace '{' to start a 'loop' loop body"_string, true); return create(AST::NameWithPosition {}, AST::NameWithPosition {}, nullptr, move(syntax_error)); // ForLoop null null Block } } @@ -776,7 +776,7 @@ RefPtr Parser::parse_loop_loop() auto cbrace_error_start = push_start(); if (!expect('}')) { auto error_start = push_start(); - auto syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close brace '}' to end a 'loop' loop body"_string), true); + auto syntax_error = create("Expected a close brace '}' to end a 'loop' loop body"_string, true); if (body) body->set_is_syntax_error(*syntax_error); else @@ -803,7 +803,7 @@ RefPtr Parser::parse_if_expr() auto cond_error_start = push_start(); condition = parse_or_logical_sequence(); if (!condition) - condition = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a logical sequence after 'if'"_string), true); + condition = create("Expected a logical sequence after 'if'"_string, true); } auto parse_braced_toplevel = [&]() -> RefPtr { @@ -811,7 +811,7 @@ RefPtr Parser::parse_if_expr() { auto obrace_error_start = push_start(); if (!expect('{')) { - body = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an open brace '{' to start an 'if' true branch"_string), true); + body = create("Expected an open brace '{' to start an 'if' true branch"_string, true); } } @@ -822,7 +822,7 @@ RefPtr Parser::parse_if_expr() auto cbrace_error_start = push_start(); if (!expect('}')) { auto error_start = push_start(); - RefPtr syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close brace '}' to end an 'if' true branch"_string), true); + RefPtr syntax_error = create("Expected a close brace '}' to end an 'if' true branch"_string, true); if (body) body->set_is_syntax_error(*syntax_error); else @@ -874,7 +874,7 @@ RefPtr Parser::parse_subshell() auto cbrace_error_start = push_start(); if (!expect('}')) { auto error_start = push_start(); - RefPtr syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close brace '}' to end a subshell"_string), true); + RefPtr syntax_error = create("Expected a close brace '}' to end a subshell"_string, true); if (body) body->set_is_syntax_error(*syntax_error); else @@ -899,7 +899,7 @@ RefPtr Parser::parse_match_expr() auto match_expression = parse_expression(); if (!match_expression) { return create( - create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an expression after 'match'"_string), true), + create("Expected an expression after 'match'"_string, true), String {}, Optional {}, Vector {}); } @@ -916,7 +916,7 @@ RefPtr Parser::parse_match_expr() auto node = create( match_expression.release_nonnull(), String {}, move(as_position), Vector {}); - node->set_is_syntax_error(create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected whitespace after 'as' in 'match'"_string), true)); + node->set_is_syntax_error(create("Expected whitespace after 'as' in 'match'"_string, true)); return node; } @@ -925,7 +925,7 @@ RefPtr Parser::parse_match_expr() auto node = create( match_expression.release_nonnull(), String {}, move(as_position), Vector {}); - node->set_is_syntax_error(create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an identifier after 'as' in 'match'"_string), true)); + node->set_is_syntax_error(create("Expected an identifier after 'as' in 'match'"_string, true)); return node; } } @@ -936,7 +936,7 @@ RefPtr Parser::parse_match_expr() auto node = create( match_expression.release_nonnull(), move(match_name), move(as_position), Vector {}); - node->set_is_syntax_error(create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an open brace '{' to start a 'match' entry list"_string), true)); + node->set_is_syntax_error(create("Expected an open brace '{' to start a 'match' entry list"_string, true)); return node; } @@ -958,7 +958,7 @@ RefPtr Parser::parse_match_expr() auto node = create( match_expression.release_nonnull(), move(match_name), move(as_position), move(entries)); - node->set_is_syntax_error(create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close brace '}' to end a 'match' entry list"_string), true)); + node->set_is_syntax_error(create("Expected a close brace '}' to end a 'match' entry list"_string, true)); return node; } @@ -991,7 +991,7 @@ AST::MatchEntry Parser::parse_match_entry() } else { auto glob_pattern = parse_match_pattern(); if (!glob_pattern) - return { Vector> {}, {}, {}, {}, create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a pattern in 'match' body"_string), true) }; + return { Vector> {}, {}, {}, {}, create("Expected a pattern in 'match' body"_string, true) }; pattern_kind = Glob; patterns.append(glob_pattern.release_nonnull()); @@ -1009,7 +1009,7 @@ AST::MatchEntry Parser::parse_match_entry() case Regex: { auto pattern = parse_regex_pattern(); if (!pattern.has_value()) { - error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a regex pattern to follow '|' in 'match' body"_string), true); + error = create("Expected a regex pattern to follow '|' in 'match' body"_string, true); break; } regexps.append(pattern.release_value()); @@ -1018,7 +1018,7 @@ AST::MatchEntry Parser::parse_match_entry() case Glob: { auto pattern = parse_match_pattern(); if (!pattern) { - error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a pattern to follow '|' in 'match' body"_string), true); + error = create("Expected a pattern to follow '|' in 'match' body"_string, true); break; } patterns.append(pattern.release_nonnull()); @@ -1041,7 +1041,7 @@ AST::MatchEntry Parser::parse_match_entry() consume_while(is_any_of(" \t\n"sv)); if (!expect('(')) { if (!error) - error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an explicit list of identifiers after a pattern 'as'"_string)); + error = create("Expected an explicit list of identifiers after a pattern 'as'"_string); } else { match_names = Vector(); for (;;) { @@ -1057,7 +1057,7 @@ AST::MatchEntry Parser::parse_match_entry() if (!expect(')')) { if (!error) - error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close paren ')' to end the identifier list of pattern 'as'"_string), true); + error = create("Expected a close paren ')' to end the identifier list of pattern 'as'"_string, true); } } consume_while(is_any_of(" \t\n"sv)); @@ -1085,7 +1085,7 @@ AST::MatchEntry Parser::parse_match_entry() if (names[index] != name.view()) { if (!error) - error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Alternative regex patterns must have the same capture groups"_string), false); + error = create("Alternative regex patterns must have the same capture groups"_string, false); break; } } @@ -1096,14 +1096,14 @@ AST::MatchEntry Parser::parse_match_entry() if (!expect('{')) { if (!error) - error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an open brace '{' to start a match entry body"_string), true); + error = create("Expected an open brace '{' to start a match entry body"_string, true); } auto body = parse_toplevel(); if (!expect('}')) { if (!error) - error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close brace '}' to end a match entry body"_string), true); + error = create("Expected a close brace '}' to end a match entry body"_string, true); } if (body && error) @@ -1182,7 +1182,7 @@ RefPtr Parser::parse_redirection() // Eat a character and hope the problem goes away consume(); } - path = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a path after redirection"_string), true); + path = create("Expected a path after redirection"_string, true); } return create(pipe_fd, path.release_nonnull()); // Redirection WriteAppend } @@ -1205,7 +1205,7 @@ RefPtr Parser::parse_redirection() } auto redir = create(pipe_fd, dest_pipe_fd); // Redirection Fd2Fd if (dest_pipe_fd == -1) - redir->set_is_syntax_error(*create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a file descriptor"_string))); + redir->set_is_syntax_error(*create("Expected a file descriptor"_string)); return redir; } consume_while(is_whitespace); @@ -1216,7 +1216,7 @@ RefPtr Parser::parse_redirection() // Eat a character and hope the problem goes away consume(); } - path = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a path after redirection"_string), true); + path = create("Expected a path after redirection"_string, true); } return create(pipe_fd, path.release_nonnull()); // Redirection Write } @@ -1240,7 +1240,7 @@ RefPtr Parser::parse_redirection() // Eat a character and hope the problem goes away consume(); } - path = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a path after redirection"_string), true); + path = create("Expected a path after redirection"_string, true); } if (mode == Read) return create(pipe_fd, path.release_nonnull()); // Redirection Read @@ -1413,10 +1413,10 @@ RefPtr Parser::parse_string() consume(); auto inner = parse_string_inner(StringEndCondition::DoubleQuote); if (!inner) - inner = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Unexpected EOF in string"_string), true); + inner = create("Unexpected EOF in string"_string, true); if (!expect('"')) { inner = create(move(inner)); - inner->set_is_syntax_error(*create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a terminating double quote"_string), true)); + inner->set_is_syntax_error(*create("Expected a terminating double quote"_string, true)); return inner; } return create(move(inner)); // Double Quoted String @@ -1430,7 +1430,7 @@ RefPtr Parser::parse_string() is_error = true; auto result = create(TRY_OR_THROW_PARSE_ERROR(String::from_utf8(text)), AST::StringLiteral::EnclosureType::SingleQuotes); // String Literal if (is_error) - result->set_is_syntax_error(*create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a terminating single quote"_string), true)); + result->set_is_syntax_error(*create("Expected a terminating single quote"_string, true)); return result; } @@ -1599,7 +1599,7 @@ RefPtr Parser::parse_slice() RefPtr error; if (peek() != ']') - error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close bracket ']' to end a variable slice"_string)); + error = create("Expected a close bracket ']' to end a variable slice"_string); else consume(); @@ -1607,7 +1607,7 @@ RefPtr Parser::parse_slice() if (error) spec = move(error); else - spec = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected either a range, or a comma-seprated list of selectors"_string)); + spec = create("Expected either a range, or a comma-seprated list of selectors"_string); } auto node = create(spec.release_nonnull()); @@ -1630,16 +1630,16 @@ RefPtr Parser::parse_evaluate() consume(); auto inner = parse_pipe_sequence(); if (!inner) - inner = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Unexpected EOF in list"_string), true); + inner = create("Unexpected EOF in list"_string, true); if (!expect(')')) - inner->set_is_syntax_error(*create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a terminating close paren"_string), true)); + inner->set_is_syntax_error(*create("Expected a terminating close paren"_string, true)); return create(inner.release_nonnull(), true); } auto inner = parse_expression(); if (!inner) { - inner = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a command"_string), true); + inner = create("Expected a command"_string, true); } else { if (inner->is_list()) { auto execute_inner = create(inner.release_nonnull(), true); @@ -1715,9 +1715,9 @@ RefPtr Parser::parse_immediate_expression() ending_brace_position); if (!ending_brace_position.has_value()) - node->set_is_syntax_error(create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a closing brace '}' to end an immediate expression"_string), true)); + node->set_is_syntax_error(create("Expected a closing brace '}' to end an immediate expression"_string, true)); else if (node->function_name().is_empty()) - node->set_is_syntax_error(create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an immediate function name"_string))); + node->set_is_syntax_error(create("Expected an immediate function name"_string)); return node; } @@ -1795,7 +1795,7 @@ RefPtr Parser::parse_history_designator() if (number != 0) selector.event.index = number - 1; else - syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("History entry index value invalid or out of range"_string)); + syntax_error = create("History entry index value invalid or out of range"_string); } if (":^$*"sv.contains(peek())) { is_word_selector = true; @@ -1855,7 +1855,7 @@ RefPtr Parser::parse_history_designator() auto first_char = peek(); if (!(is_digit(first_char) || "^$-*"sv.contains(first_char))) { if (!syntax_error) - syntax_error = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a word selector after ':' in a history event designator"_string), true); + syntax_error = create("Expected a word selector after ':' in a history event designator"_string, true); } else if (first_char == '*') { consume(); selector.word_selector_range.start = make_word_selector(AST::HistorySelector::WordSelectorKind::Index, 1); @@ -2055,7 +2055,7 @@ RefPtr Parser::parse_brace_expansion() if (auto spec = parse_brace_expansion_spec()) { if (!expect('}')) - spec->set_is_syntax_error(create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a close brace '}' to end a brace expansion"_string), true)); + spec->set_is_syntax_error(create("Expected a close brace '}' to end a brace expansion"_string, true)); return spec; } @@ -2083,12 +2083,12 @@ RefPtr Parser::parse_brace_expansion_spec() if (expect(".."sv)) { if (auto end_expr = parse_expression()) { if (end_expr->position().start_offset != start_expr->position().end_offset + 2) - end_expr->set_is_syntax_error(create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected no whitespace between '..' and the following expression in brace expansion"_string))); + end_expr->set_is_syntax_error(create("Expected no whitespace between '..' and the following expression in brace expansion"_string)); return create(start_expr.release_nonnull(), end_expr.release_nonnull()); } - return create(start_expr.release_nonnull(), create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected an expression to end range brace expansion with"_string), true)); + return create(start_expr.release_nonnull(), create("Expected an expression to end range brace expansion with"_string, true)); } } @@ -2123,7 +2123,7 @@ RefPtr Parser::parse_heredoc_initiation_record() consume(); HeredocInitiationRecord record; - record.end = TRY_OR_THROW_PARSE_ERROR(""_string); + record.end = ""_string; RefPtr syntax_error_node; @@ -2161,12 +2161,12 @@ RefPtr Parser::parse_heredoc_initiation_record() if (!expect('\'')) is_error = true; if (is_error) - syntax_error_node = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a terminating single quote"_string), true); + syntax_error_node = create("Expected a terminating single quote"_string, true); record.end = TRY_OR_THROW_PARSE_ERROR(String::from_utf8(text)); record.interpolate = false; } else { - syntax_error_node = create(TRY_OR_RESOLVE_TO_ERROR_STRING("Expected a bareword or a single-quoted string literal for heredoc end key"_string), true); + syntax_error_node = create("Expected a bareword or a single-quoted string literal for heredoc end key"_string, true); } auto node = create(record.end, record.interpolate, record.deindent); diff --git a/Userland/Shell/PosixParser.cpp b/Userland/Shell/PosixParser.cpp index 951050aa5ac..973e5f2488a 100644 --- a/Userland/Shell/PosixParser.cpp +++ b/Userland/Shell/PosixParser.cpp @@ -664,7 +664,7 @@ ErrorOr> Parser::parse_complete_command() auto position = peek().position; auto syntax_error = make_ref_counted( position.value_or(empty_position()), - TRY("Extra tokens after complete command"_string)); + "Extra tokens after complete command"_string); if (list) list->set_is_syntax_error(*syntax_error); @@ -968,13 +968,13 @@ ErrorOr> Parser::parse_while_clause() if (!condition) condition = make_ref_counted( peek().position.value_or(empty_position()), - TRY("Expected condition after 'while'"_string)); + "Expected condition after 'while'"_string); auto do_group = TRY(parse_do_group()); if (!do_group) do_group = make_ref_counted( peek().position.value_or(empty_position()), - TRY("Expected 'do' after 'while'"_string)); + "Expected 'do' after 'while'"_string); // while foo; bar -> loop { if foo { bar } else { break } } auto position = start_position.with_end(peek().position.value_or(empty_position())); @@ -1004,13 +1004,13 @@ ErrorOr> Parser::parse_until_clause() if (!condition) condition = make_ref_counted( peek().position.value_or(empty_position()), - TRY("Expected condition after 'until'"_string)); + "Expected condition after 'until'"_string); auto do_group = TRY(parse_do_group()); if (!do_group) do_group = make_ref_counted( peek().position.value_or(empty_position()), - TRY("Expected 'do' after 'until'"_string)); + "Expected 'do' after 'until'"_string); // until foo; bar -> loop { if foo { break } else { bar } } auto position = start_position.with_end(peek().position.value_or(empty_position())); @@ -1214,7 +1214,7 @@ ErrorOr> Parser::parse_if_clause() skip(); auto main_condition = TRY(parse_compound_list()); if (!main_condition) - main_condition = make_ref_counted(empty_position(), TRY("Expected compound list after 'if'"_string)); + main_condition = make_ref_counted(empty_position(), "Expected compound list after 'if'"_string); RefPtr syntax_error; if (peek().type != Token::Type::Then) { @@ -1227,7 +1227,7 @@ ErrorOr> Parser::parse_if_clause() auto main_consequence = TRY(parse_compound_list()); if (!main_consequence) - main_consequence = make_ref_counted(empty_position(), TRY("Expected compound list after 'then'"_string)); + main_consequence = make_ref_counted(empty_position(), "Expected compound list after 'then'"_string); auto node = make_ref_counted(start_position, Optional(), main_condition.release_nonnull(), main_consequence.release_nonnull(), nullptr); auto active_node = node; @@ -1236,7 +1236,7 @@ ErrorOr> Parser::parse_if_clause() skip(); auto condition = TRY(parse_compound_list()); if (!condition) - condition = make_ref_counted(empty_position(), TRY("Expected compound list after 'elif'"_string)); + condition = make_ref_counted(empty_position(), "Expected compound list after 'elif'"_string); if (peek().type != Token::Type::Then) { if (!syntax_error) @@ -1249,7 +1249,7 @@ ErrorOr> Parser::parse_if_clause() auto consequence = TRY(parse_compound_list()); if (!consequence) - consequence = make_ref_counted(empty_position(), TRY("Expected compound list after 'then'"_string)); + consequence = make_ref_counted(empty_position(), "Expected compound list after 'then'"_string); auto new_node = make_ref_counted(start_position, Optional(), condition.release_nonnull(), consequence.release_nonnull(), nullptr); @@ -1263,7 +1263,7 @@ ErrorOr> Parser::parse_if_clause() skip(); active_node->false_branch() = TRY(parse_compound_list()); if (!active_node->false_branch()) - active_node->false_branch() = make_ref_counted(empty_position(), TRY("Expected compound list after 'else'"_string)); + active_node->false_branch() = make_ref_counted(empty_position(), "Expected compound list after 'else'"_string); break; case Token::Type::Fi: skip(); @@ -1305,10 +1305,10 @@ ErrorOr> Parser::parse_subshell() auto list = TRY(parse_compound_list()); if (!list) - error = make_ref_counted(peek().position.value_or(empty_position()), TRY("Expected compound list after ("_string)); + error = make_ref_counted(peek().position.value_or(empty_position()), "Expected compound list after ("_string); if (peek().type != Token::Type::CloseParen) - error = make_ref_counted(peek().position.value_or(empty_position()), TRY("Expected ) after compound list"_string)); + error = make_ref_counted(peek().position.value_or(empty_position()), "Expected ) after compound list"_string); else skip(); @@ -1535,14 +1535,14 @@ ErrorOr> Parser::parse_word() auto node = make_ref_counted( token.position.value_or(empty_position()), AST::NameWithPosition { - TRY("math"_string), + "math"_string, token.position.value_or(empty_position()), }, Vector> { make_ref_counted( token.position.value_or(empty_position()), AST::NameWithPosition { - TRY("reexpand"_string), + "reexpand"_string, token.position.value_or(empty_position()), }, Vector> { @@ -1617,7 +1617,7 @@ ErrorOr> Parser::parse_word() case ResolvedParameterExpansion::Op::GetLastBackgroundPid: node = make_ref_counted( token.position.value_or(empty_position()), - TRY("$! not implemented"_string)); + "$! not implemented"_string); break; case ResolvedParameterExpansion::Op::GetPositionalParameterList: node = make_ref_counted( @@ -1627,7 +1627,7 @@ ErrorOr> Parser::parse_word() case ResolvedParameterExpansion::Op::GetCurrentOptionFlags: node = make_ref_counted( token.position.value_or(empty_position()), - TRY("The current option flags are not available in parameter expansions"_string)); + "The current option flags are not available in parameter expansions"_string); break; case ResolvedParameterExpansion::Op::GetPositionalParameterCount: node = make_ref_counted( @@ -1642,7 +1642,7 @@ ErrorOr> Parser::parse_word() case ResolvedParameterExpansion::Op::GetPositionalParameterListAsString: node = make_ref_counted( token.position.value_or(empty_position()), - TRY("$* not implemented"_string)); + "$* not implemented"_string); break; case ResolvedParameterExpansion::Op::GetShellProcessId: node = make_ref_counted( @@ -1676,7 +1676,7 @@ ErrorOr> Parser::parse_word() node = make_ref_counted( token.position.value_or(empty_position()), AST::NameWithPosition { - TRY("reexpand"_string), + "reexpand"_string, token.position.value_or(empty_position()), }, Vector { node.release_nonnull() }, @@ -1904,14 +1904,14 @@ ErrorOr> Parser::parse_simple_command() // run_with_env -e*(assignments) -- (command) nodes.append(make_ref_counted( empty_position(), - TRY("run_with_env"_string))); + "run_with_env"_string)); } auto position = peek().position.value_or(empty_position()); nodes.append(make_ref_counted( position, AST::NameWithPosition { - TRY("reexpand"_string), + "reexpand"_string, position, }, Vector> { @@ -1947,7 +1947,7 @@ ErrorOr> Parser::parse_simple_command() auto expanded_value = make_ref_counted( position, AST::NameWithPosition { - TRY("reexpand"_string), + "reexpand"_string, position, }, Vector> { @@ -2034,7 +2034,7 @@ ErrorOr> Parser::parse_io_here(AST::Position start_position, O auto end_keyword = consume(); if (!is_one_of(end_keyword.type, Token::Type::Word, Token::Type::Token)) - return make_ref_counted(io_operator_token.position.value_or(start_position), TRY("Expected a heredoc keyword"_string), true); + return make_ref_counted(io_operator_token.position.value_or(start_position), "Expected a heredoc keyword"_string, true); auto [end_keyword_text, allow_interpolation] = Lexer::process_heredoc_key(end_keyword); RefPtr error; diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index 8b926338802..84f878f555d 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -1743,7 +1743,7 @@ ErrorOr> Shell::complete_via_program_itself(s else if (!options.invoke_program_for_autocomplete) return Error::from_string_literal("Refusing to use the program itself as completion source"); - completion_command.argv.extend({ TRY("--complete"_string), "--"_short_string }); + completion_command.argv.extend({ "--complete"_string, "--"_short_string }); struct Visitor : public AST::NodeVisitor { Visitor(Shell& shell, AST::Position position) @@ -1912,7 +1912,7 @@ ErrorOr> Shell::complete_via_program_itself(s completion_command.argv.extend(visitor.list()); - auto devnull = TRY("/dev/null"_string); + auto devnull = "/dev/null"_string; completion_command.should_wait = true; completion_command.redirections.append(AST::PathRedirection::create(devnull, STDERR_FILENO, AST::PathRedirection::Write)); completion_command.redirections.append(AST::PathRedirection::create(devnull, STDIN_FILENO, AST::PathRedirection::Read)); diff --git a/Userland/Utilities/man.cpp b/Userland/Utilities/man.cpp index 072f20dd8aa..e6a51b01a6b 100644 --- a/Userland/Utilities/man.cpp +++ b/Userland/Utilities/man.cpp @@ -95,7 +95,7 @@ ErrorOr serenity_main(Main::Arguments arguments) dbgln("Loading man page from {}", TRY(page->path())); auto buffer = TRY(file->read_until_eof()); - auto const title = TRY("SerenityOS manual"_string); + auto const title = "SerenityOS manual"_string; int spaces = max(view_width / 2 - page_name.code_points().length() - section_number.code_points().length() - title.code_points().length() / 2 - 4, 0); outln("{}({}){}{}", page_name, section_number, String::repeated(' ', spaces), title); diff --git a/Userland/Utilities/mktemp.cpp b/Userland/Utilities/mktemp.cpp index 9d3d17252f2..08b3fc1cace 100644 --- a/Userland/Utilities/mktemp.cpp +++ b/Userland/Utilities/mktemp.cpp @@ -88,7 +88,7 @@ ErrorOr serenity_main(Main::Arguments arguments) } if (!final_file_template.has_value()) { - final_file_template = TRY("tmp.XXXXXXXXXX"_string); + final_file_template = "tmp.XXXXXXXXXX"_string; } if (!final_file_template->find_byte_offset("XXX"sv).has_value()) {