mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 20:37:35 +00:00
Everywhere: Use Core::ConfigFile::AllowWriting::Yes to allow writing
This commit is contained in:
parent
54bbe52b51
commit
938051feb8
25 changed files with 29 additions and 29 deletions
|
@ -37,7 +37,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto window = GUI::Window::construct();
|
||||
|
||||
auto config = Core::ConfigFile::get_for_app("2048");
|
||||
auto config = Core::ConfigFile::get_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");
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_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");
|
||||
auto config = Core::ConfigFile::get_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");
|
||||
auto config = Core::ConfigFile::get_for_app("Hearts", Core::ConfigFile::AllowWriting::Yes);
|
||||
|
||||
if (pledge("stdio recvfd sendfd rpath wpath cpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
|
|
@ -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");
|
||||
auto config = Core::ConfigFile::get_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");
|
||||
auto config = Core::ConfigFile::get_for_app("Minesweeper", Core::ConfigFile::AllowWriting::Yes);
|
||||
m_single_chording = enabled;
|
||||
config->write_bool_entry("Minesweeper", "SingleChording", m_single_chording);
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
auto config = Core::ConfigFile::get_for_app("Snake", Core::ConfigFile::AllowWriting::Yes);
|
||||
config->write_num_entry("Snake", "HighScore", m_high_score);
|
||||
}
|
||||
update(score_rect());
|
||||
|
|
|
@ -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");
|
||||
auto config = Core::ConfigFile::get_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");
|
||||
auto config = Core::ConfigFile::get_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