mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 02:38:13 +00:00
Snake: Use LibConfig instead of Core::ConfigFile
This commit is contained in:
parent
3ad9df1522
commit
458471cc37
3 changed files with 8 additions and 14 deletions
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "SnakeGame.h"
|
||||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibConfig/Client.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
|
@ -26,23 +26,18 @@ int main(int argc, char** argv)
|
|||
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
Config::pledge_domains("Snake");
|
||||
|
||||
if (pledge("stdio rpath wpath cpath recvfd sendfd", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto config = Core::ConfigFile::open_for_app("Snake");
|
||||
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue