mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 06:47:34 +00:00
Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to open
This patch brings the ConfigFile helpers for opening lib, app and system configs more inline with the regular ConfigFile::open functions.
This commit is contained in:
parent
938051feb8
commit
acde7d12b0
37 changed files with 51 additions and 51 deletions
|
@ -37,7 +37,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto window = GUI::Window::construct();
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("2048", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("2048", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
size_t board_size = config->read_num_entry("", "board_size", 4);
|
||||
u32 target_tile = config->read_num_entry("", "target_tile", 2048);
|
||||
|
|
|
@ -26,7 +26,7 @@ int main(int argc, char** argv)
|
|||
auto window = GUI::Window::construct();
|
||||
auto& widget = window->set_main_widget<ChessWidget>();
|
||||
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Chess", Core::ConfigFile::AllowWriting::Yes);
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::open_for_app("Chess", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio rpath wpath cpath recvfd sendfd thread proc exec", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -22,7 +22,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto config = Core::ConfigFile::get_for_app("FlappyBug", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("FlappyBug", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio rpath wpath cpath recvfd sendfd", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -26,7 +26,7 @@ int main(int argc, char** argv)
|
|||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto app_icon = GUI::Icon::default_icon("app-hearts");
|
||||
auto config = Core::ConfigFile::get_for_app("Hearts", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Hearts", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio recvfd sendfd rpath wpath cpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -137,7 +137,7 @@ Field::Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_b
|
|||
set_face(Face::Default);
|
||||
|
||||
{
|
||||
auto config = Core::ConfigFile::get_for_app("Minesweeper");
|
||||
auto config = Core::ConfigFile::open_for_app("Minesweeper");
|
||||
bool single_chording = config->read_num_entry("Minesweeper", "SingleChording", false);
|
||||
int mine_count = config->read_num_entry("Game", "MineCount", 10);
|
||||
int rows = config->read_num_entry("Game", "Rows", 9);
|
||||
|
@ -488,7 +488,7 @@ void Field::set_field_size(size_t rows, size_t columns, size_t mine_count)
|
|||
if (m_rows == rows && m_columns == columns && m_mine_count == mine_count)
|
||||
return;
|
||||
{
|
||||
auto config = Core::ConfigFile::get_for_app("Minesweeper", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Minesweeper", Core::ConfigFile::AllowWriting::Yes);
|
||||
config->write_num_entry("Game", "MineCount", mine_count);
|
||||
config->write_num_entry("Game", "Rows", rows);
|
||||
config->write_num_entry("Game", "Columns", columns);
|
||||
|
@ -503,7 +503,7 @@ void Field::set_field_size(size_t rows, size_t columns, size_t mine_count)
|
|||
|
||||
void Field::set_single_chording(bool enabled)
|
||||
{
|
||||
auto config = Core::ConfigFile::get_for_app("Minesweeper", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Minesweeper", Core::ConfigFile::AllowWriting::Yes);
|
||||
m_single_chording = enabled;
|
||||
config->write_bool_entry("Minesweeper", "SingleChording", m_single_chording);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Minesweeper");
|
||||
auto config = Core::ConfigFile::open_for_app("Minesweeper");
|
||||
|
||||
if (unveil("/res", "r") < 0) {
|
||||
perror("unveil");
|
||||
|
|
|
@ -28,7 +28,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Pong");
|
||||
auto config = Core::ConfigFile::open_for_app("Pong");
|
||||
|
||||
if (unveil("/res", "r") < 0) {
|
||||
perror("unveil");
|
||||
|
|
|
@ -23,7 +23,7 @@ SnakeGame::SnakeGame()
|
|||
srand(time(nullptr));
|
||||
reset();
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Snake");
|
||||
auto config = Core::ConfigFile::open_for_app("Snake");
|
||||
m_high_score = config->read_num_entry("Snake", "HighScore", 0);
|
||||
m_high_score_text = String::formatted("Best: {}", m_high_score);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ void SnakeGame::timer_event(Core::TimerEvent&)
|
|||
m_high_score = m_score;
|
||||
m_high_score_text = String::formatted("Best: {}", m_high_score);
|
||||
update(high_score_rect());
|
||||
auto config = Core::ConfigFile::get_for_app("Snake", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Snake", Core::ConfigFile::AllowWriting::Yes);
|
||||
config->write_num_entry("Snake", "HighScore", m_high_score);
|
||||
}
|
||||
update(score_rect());
|
||||
|
|
|
@ -31,7 +31,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("Snake");
|
||||
auto config = Core::ConfigFile::open_for_app("Snake");
|
||||
|
||||
if (unveil("/res", "r") < 0) {
|
||||
perror("unveil");
|
||||
|
|
|
@ -24,7 +24,7 @@ int main(int argc, char** argv)
|
|||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto app_icon = GUI::Icon::default_icon("app-solitaire");
|
||||
auto config = Core::ConfigFile::get_for_app("Solitaire", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Solitaire", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio recvfd sendfd rpath wpath cpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -39,7 +39,7 @@ int main(int argc, char** argv)
|
|||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto app_icon = GUI::Icon::default_icon("app-spider");
|
||||
auto config = Core::ConfigFile::get_for_app("Spider", Core::ConfigFile::AllowWriting::Yes);
|
||||
auto config = Core::ConfigFile::open_for_app("Spider", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio recvfd sendfd rpath wpath cpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue