1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

Minesweeper: Use LibConfig instead of Core::ConfigFile

This commit is contained in:
Andreas Kling 2021-08-26 00:52:08 +02:00
parent d9b5dae809
commit 827bf5232e
3 changed files with 14 additions and 22 deletions

View file

@ -5,7 +5,7 @@
*/
#include "Field.h"
#include <LibCore/ConfigFile.h>
#include <LibConfig/Client.h>
#include <LibGUI/Action.h>
#include <LibGUI/Application.h>
#include <LibGUI/BoxLayout.h>
@ -28,23 +28,18 @@ int main(int argc, char** argv)
auto app = GUI::Application::construct(argc, argv);
Config::pledge_domains("Minesweeper");
if (pledge("stdio rpath wpath cpath recvfd sendfd", nullptr) < 0) {
perror("pledge");
return 1;
}
auto config = Core::ConfigFile::open_for_app("Minesweeper");
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
if (unveil(config->filename().characters(), "crw") < 0) {
perror("unveil");
return 1;
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;