1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

MailSettings: Port to LibMain :^)

This commit is contained in:
Andreas Kling 2021-11-27 17:21:28 +01:00
parent 984cf1fe7a
commit 8a11e986e5
2 changed files with 9 additions and 22 deletions

View file

@ -14,4 +14,4 @@ set(SOURCES
) )
serenity_app(MailSettings ICON app-mail) serenity_app(MailSettings ICON app-mail)
target_link_libraries(MailSettings LibConfig LibGUI) target_link_libraries(MailSettings LibConfig LibGUI LibMain)

View file

@ -7,36 +7,23 @@
#include "MailSettingsWidget.h" #include "MailSettingsWidget.h"
#include <LibConfig/Client.h> #include <LibConfig/Client.h>
#include <LibCore/System.h>
#include <LibGUI/Application.h> #include <LibGUI/Application.h>
#include <LibGUI/Icon.h> #include <LibGUI/Icon.h>
#include <LibGUI/SettingsWindow.h> #include <LibGUI/SettingsWindow.h>
#include <unistd.h> #include <LibMain/Main.h>
int main(int argc, char** argv) ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
if (pledge("stdio rpath recvfd sendfd unix", nullptr) < 0) { TRY(Core::System::pledge("stdio rpath recvfd sendfd unix"));
perror("pledge");
return 1;
}
auto app = GUI::Application::construct(argc, argv); auto app = TRY(GUI::Application::try_create(arguments));
Config::pledge_domains("Mail"); Config::pledge_domains("Mail");
if (pledge("stdio rpath recvfd sendfd", nullptr) < 0) { TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
perror("pledge"); TRY(Core::System::unveil("/res", "r"));
return 1; TRY(Core::System::unveil(nullptr, nullptr));
}
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
if (unveil(nullptr, nullptr)) {
perror("unveil");
return 1;
}
auto app_icon = GUI::Icon::default_icon("app-mail"); auto app_icon = GUI::Icon::default_icon("app-mail");