1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 17:25:10 +00:00

TextEditor: Use LibConfig instead of Core::ConfigFile

This commit is contained in:
Andreas Kling 2021-08-25 23:56:50 +02:00
parent 3114fe612c
commit 0cd4b8cbb7
4 changed files with 11 additions and 31 deletions

View file

@ -6,6 +6,7 @@
#include "FileArgument.h"
#include "MainWidget.h"
#include <LibConfig/Client.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/File.h>
#include <LibCore/StandardPaths.h>
@ -23,6 +24,8 @@ int main(int argc, char** argv)
auto app = GUI::Application::construct(argc, argv);
Config::pledge_domains("TextEditor");
char const* preview_mode = "auto";
char const* file_to_edit = nullptr;
Core::ArgsParser parser;
@ -32,7 +35,6 @@ int main(int argc, char** argv)
parser.parse(argc, argv);
String file_to_edit_full_path;
auto config_filename = MainWidget::open_config_file()->filename();
if (file_to_edit) {
FileArgument parsed_argument(file_to_edit);
@ -48,11 +50,6 @@ int main(int argc, char** argv)
}
}
if (unveil(config_filename.characters(), "rwc") < 0) {
perror("unveil");
return 1;
}
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;