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

Mail: Port to LibMain

This commit is contained in:
Pascal Puffke 2021-11-22 23:25:38 +01:00 committed by Andreas Kling
parent 41b80f3d85
commit ca7b603578
2 changed files with 11 additions and 33 deletions

View file

@ -16,4 +16,4 @@ set(SOURCES
) )
serenity_app(Mail ICON app-mail) serenity_app(Mail ICON app-mail)
target_link_libraries(Mail LibConfig LibCore LibDesktop LibGfx LibGUI LibIMAP LibWeb) target_link_libraries(Mail LibConfig LibCore LibDesktop LibGfx LibGUI LibIMAP LibWeb LibMain)

View file

@ -11,44 +11,22 @@
#include <LibGUI/Menu.h> #include <LibGUI/Menu.h>
#include <LibGUI/Menubar.h> #include <LibGUI/Menubar.h>
#include <LibGUI/Window.h> #include <LibGUI/Window.h>
#include <stdio.h> #include <LibMain/Main.h>
#include <unistd.h> #include <LibSystem/Wrappers.h>
int main(int argc, char** argv) ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
if (pledge("stdio recvfd sendfd rpath unix inet", nullptr) < 0) { TRY(System::pledge("stdio recvfd sendfd rpath unix inet", nullptr));
perror("pledge");
return 1;
}
auto app = GUI::Application::construct(argc, argv); auto app = GUI::Application::construct(arguments.argc, arguments.argv);
Config::pledge_domains("Mail"); Config::pledge_domains("Mail");
if (unveil("/res", "r") < 0) { TRY(System::unveil("/res", "r"));
perror("pledge"); TRY(System::unveil("/etc", "r"));
return 1; TRY(System::unveil("/tmp/portal/webcontent", "rw"));
} TRY(System::unveil("/tmp/portal/lookup", "rw"));
TRY(System::unveil(nullptr, nullptr));
if (unveil("/etc", "r") < 0) {
perror("pledge");
return 1;
}
if (unveil("/tmp/portal/webcontent", "rw") < 0) {
perror("unveil");
return 1;
}
if (unveil("/tmp/portal/lookup", "rw") < 0) {
perror("unveil");
return 1;
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
}
auto window = GUI::Window::construct(); auto window = GUI::Window::construct();