summaryrefslogtreecommitdiff
path: root/Userland/Games
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-01-07 12:33:53 +0000
committerLinus Groh <mail@linusgroh.de>2023-01-07 14:39:30 +0100
commit54b1326165dd97ae3dab82360d0e7b029650004d (patch)
treebf0761a91ae3717da5e59356108e6d3260fd9137 /Userland/Games
parent703da34947b147763815da9fee89ce2ba05372b7 (diff)
downloadserenity-54b1326165dd97ae3dab82360d0e7b029650004d.zip
Userland: Replace all uses of `load_from_gml` with `try_load_from_gml`
MOAR FIXMES! ;^)
Diffstat (limited to 'Userland/Games')
-rw-r--r--Userland/Games/2048/GameSizeDialog.cpp3
-rw-r--r--Userland/Games/2048/main.cpp3
-rw-r--r--Userland/Games/Flood/SettingsDialog.cpp3
-rw-r--r--Userland/Games/Flood/main.cpp3
-rw-r--r--Userland/Games/GameOfLife/main.cpp2
-rw-r--r--Userland/Games/Hearts/main.cpp2
-rw-r--r--Userland/Games/MasterWord/main.cpp2
-rw-r--r--Userland/Games/Minesweeper/CustomGameDialog.cpp3
-rw-r--r--Userland/Games/Minesweeper/main.cpp2
9 files changed, 9 insertions, 14 deletions
diff --git a/Userland/Games/2048/GameSizeDialog.cpp b/Userland/Games/2048/GameSizeDialog.cpp
index a2ef18d80b..98d7304615 100644
--- a/Userland/Games/2048/GameSizeDialog.cpp
+++ b/Userland/Games/2048/GameSizeDialog.cpp
@@ -26,8 +26,7 @@ GameSizeDialog::GameSizeDialog(GUI::Window* parent, size_t board_size, size_t ta
set_resizable(false);
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
- if (!main_widget->load_from_gml(game_size_dialog_gml))
- VERIFY_NOT_REACHED();
+ main_widget->try_load_from_gml(game_size_dialog_gml).release_value_but_fixme_should_propagate_errors();
auto board_size_spinbox = main_widget->find_descendant_of_type_named<GUI::SpinBox>("board_size_spinbox");
board_size_spinbox->set_value(m_board_size);
diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp
index 935190bb8c..fb65e60e16 100644
--- a/Userland/Games/2048/main.cpp
+++ b/Userland/Games/2048/main.cpp
@@ -67,8 +67,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->resize(315, 336);
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
- if (!main_widget->load_from_gml(game_window_gml))
- VERIFY_NOT_REACHED();
+ TRY(main_widget->try_load_from_gml(game_window_gml));
Game game { board_size, target_tile, evil_ai };
diff --git a/Userland/Games/Flood/SettingsDialog.cpp b/Userland/Games/Flood/SettingsDialog.cpp
index 873cab5ede..1cfd010fb5 100644
--- a/Userland/Games/Flood/SettingsDialog.cpp
+++ b/Userland/Games/Flood/SettingsDialog.cpp
@@ -28,8 +28,7 @@ SettingsDialog::SettingsDialog(GUI::Window* parent, size_t board_rows, size_t bo
set_resizable(false);
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
- if (!main_widget->load_from_gml(settings_dialog_gml))
- VERIFY_NOT_REACHED();
+ main_widget->try_load_from_gml(settings_dialog_gml).release_value_but_fixme_should_propagate_errors();
auto board_rows_spinbox = main_widget->find_descendant_of_type_named<GUI::SpinBox>("board_rows_spinbox");
board_rows_spinbox->set_value(m_board_rows);
diff --git a/Userland/Games/Flood/main.cpp b/Userland/Games/Flood/main.cpp
index de902a1414..fc5ab37a44 100644
--- a/Userland/Games/Flood/main.cpp
+++ b/Userland/Games/Flood/main.cpp
@@ -83,8 +83,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->resize(304, 325);
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
- if (!main_widget->load_from_gml(flood_window_gml))
- VERIFY_NOT_REACHED();
+ TRY(main_widget->try_load_from_gml(flood_window_gml));
auto board_widget = TRY(main_widget->find_descendant_of_type_named<GUI::Widget>("board_widget_container")->try_add<BoardWidget>(board_rows, board_columns));
board_widget->board()->randomize();
diff --git a/Userland/Games/GameOfLife/main.cpp b/Userland/Games/GameOfLife/main.cpp
index 2ab0f5c143..3e385e5791 100644
--- a/Userland/Games/GameOfLife/main.cpp
+++ b/Userland/Games/GameOfLife/main.cpp
@@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_title("Game Of Life");
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
- main_widget->load_from_gml(game_of_life_gml);
+ TRY(main_widget->try_load_from_gml(game_of_life_gml));
main_widget->set_fill_with_background_color(true);
auto& main_toolbar = *main_widget->find_descendant_of_type_named<GUI::Toolbar>("toolbar");
diff --git a/Userland/Games/Hearts/main.cpp b/Userland/Games/Hearts/main.cpp
index 30617193fe..2707e03de9 100644
--- a/Userland/Games/Hearts/main.cpp
+++ b/Userland/Games/Hearts/main.cpp
@@ -51,7 +51,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_title("Hearts");
auto widget = TRY(window->set_main_widget<GUI::Widget>());
- widget->load_from_gml(hearts_gml);
+ TRY(widget->try_load_from_gml(hearts_gml));
auto& game = *widget->find_descendant_of_type_named<Hearts::Game>("game");
game.set_focus(true);
diff --git a/Userland/Games/MasterWord/main.cpp b/Userland/Games/MasterWord/main.cpp
index 4801e06ec6..f5ce72ff33 100644
--- a/Userland/Games/MasterWord/main.cpp
+++ b/Userland/Games/MasterWord/main.cpp
@@ -47,7 +47,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_resizable(false);
auto main_widget = TRY(window->set_main_widget<GUI::Widget>());
- main_widget->load_from_gml(master_word_gml);
+ TRY(main_widget->try_load_from_gml(master_word_gml));
auto& game = *main_widget->find_descendant_of_type_named<MasterWord::WordGame>("word_game");
auto& statusbar = *main_widget->find_descendant_of_type_named<GUI::Statusbar>("statusbar");
diff --git a/Userland/Games/Minesweeper/CustomGameDialog.cpp b/Userland/Games/Minesweeper/CustomGameDialog.cpp
index 081b7eb3ce..f8c99fff0d 100644
--- a/Userland/Games/Minesweeper/CustomGameDialog.cpp
+++ b/Userland/Games/Minesweeper/CustomGameDialog.cpp
@@ -46,8 +46,7 @@ CustomGameDialog::CustomGameDialog(Window* parent_window)
set_title("Custom game");
auto main_widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
- if (!main_widget->load_from_gml(minesweeper_custom_game_window_gml))
- VERIFY_NOT_REACHED();
+ main_widget->try_load_from_gml(minesweeper_custom_game_window_gml).release_value_but_fixme_should_propagate_errors();
m_columns_spinbox = *main_widget->find_descendant_of_type_named<GUI::SpinBox>("columns_spinbox");
m_rows_spinbox = *main_widget->find_descendant_of_type_named<GUI::SpinBox>("rows_spinbox");
diff --git a/Userland/Games/Minesweeper/main.cpp b/Userland/Games/Minesweeper/main.cpp
index 49e1062f77..360833a187 100644
--- a/Userland/Games/Minesweeper/main.cpp
+++ b/Userland/Games/Minesweeper/main.cpp
@@ -50,7 +50,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->resize(139, 177);
auto widget = TRY(window->set_main_widget<GUI::Widget>());
- widget->load_from_gml(minesweeper_window_gml);
+ TRY(widget->try_load_from_gml(minesweeper_window_gml));
auto& separator = *widget->find_descendant_of_type_named<GUI::HorizontalSeparator>("separator");
auto& container = *widget->find_descendant_of_type_named<GUI::Widget>("container");