summaryrefslogtreecommitdiff
path: root/Userland/Games
diff options
context:
space:
mode:
authornetworkException <git@nwex.de>2021-08-21 16:14:30 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-22 01:32:25 +0200
commit938051feb8d9340657251082f3fd4abffd57b813 (patch)
tree7d71e8c592b4915dcb4930fde8ba6739f60450f1 /Userland/Games
parent54bbe52b5143954dcdb700207de43343e5102ab8 (diff)
downloadserenity-938051feb8d9340657251082f3fd4abffd57b813.zip
Everywhere: Use Core::ConfigFile::AllowWriting::Yes to allow writing
Diffstat (limited to 'Userland/Games')
-rw-r--r--Userland/Games/2048/main.cpp2
-rw-r--r--Userland/Games/Chess/main.cpp2
-rw-r--r--Userland/Games/FlappyBug/main.cpp2
-rw-r--r--Userland/Games/Hearts/main.cpp2
-rw-r--r--Userland/Games/Minesweeper/Field.cpp4
-rw-r--r--Userland/Games/Snake/SnakeGame.cpp2
-rw-r--r--Userland/Games/Solitaire/main.cpp2
-rw-r--r--Userland/Games/Spider/main.cpp2
8 files changed, 9 insertions, 9 deletions
diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp
index 22a5d5fd94..eb7b9aeccf 100644
--- a/Userland/Games/2048/main.cpp
+++ b/Userland/Games/2048/main.cpp
@@ -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);
diff --git a/Userland/Games/Chess/main.cpp b/Userland/Games/Chess/main.cpp
index e4679f75ab..b883eb9a98 100644
--- a/Userland/Games/Chess/main.cpp
+++ b/Userland/Games/Chess/main.cpp
@@ -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");
diff --git a/Userland/Games/FlappyBug/main.cpp b/Userland/Games/FlappyBug/main.cpp
index a8209337c8..cfce33f1a7 100644
--- a/Userland/Games/FlappyBug/main.cpp
+++ b/Userland/Games/FlappyBug/main.cpp
@@ -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");
diff --git a/Userland/Games/Hearts/main.cpp b/Userland/Games/Hearts/main.cpp
index 8a020d4b69..73c9b8da21 100644
--- a/Userland/Games/Hearts/main.cpp
+++ b/Userland/Games/Hearts/main.cpp
@@ -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");
diff --git a/Userland/Games/Minesweeper/Field.cpp b/Userland/Games/Minesweeper/Field.cpp
index 26c563745d..9191552be4 100644
--- a/Userland/Games/Minesweeper/Field.cpp
+++ b/Userland/Games/Minesweeper/Field.cpp
@@ -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);
}
diff --git a/Userland/Games/Snake/SnakeGame.cpp b/Userland/Games/Snake/SnakeGame.cpp
index 328a0ae255..e8bf10737e 100644
--- a/Userland/Games/Snake/SnakeGame.cpp
+++ b/Userland/Games/Snake/SnakeGame.cpp
@@ -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());
diff --git a/Userland/Games/Solitaire/main.cpp b/Userland/Games/Solitaire/main.cpp
index 7bec5ccf4d..a51fca313b 100644
--- a/Userland/Games/Solitaire/main.cpp
+++ b/Userland/Games/Solitaire/main.cpp
@@ -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");
diff --git a/Userland/Games/Spider/main.cpp b/Userland/Games/Spider/main.cpp
index 262474811d..fa2c8cd4d3 100644
--- a/Userland/Games/Spider/main.cpp
+++ b/Userland/Games/Spider/main.cpp
@@ -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");