mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
PixelPaint: Use FileSystemAccessClient::try_* APIs
This commit is contained in:
parent
aae96af812
commit
1c3e93c6e0
Notes:
sideshowbarker
2024-07-17 20:34:34 +09:00
Author: https://github.com/mustafaquraish
Commit: 1c3e93c6e0
Pull-request: https://github.com/SerenityOS/serenity/pull/11968
Reviewed-by: https://github.com/TobyAsE
11 changed files with 59 additions and 105 deletions
|
@ -71,13 +71,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->show();
|
||||
|
||||
if (image_file) {
|
||||
auto response = FileSystemAccessClient::Client::the().request_file_read_only_approved(window->window_id(), image_file);
|
||||
if (response.error != 0) {
|
||||
if (response.error != -1)
|
||||
GUI::MessageBox::show_error(window, String::formatted("Opening \"{}\" failed: {}", *response.chosen_file, strerror(response.error)));
|
||||
auto response = FileSystemAccessClient::Client::the().try_request_file_read_only_approved(window, image_file);
|
||||
if (response.is_error())
|
||||
return 1;
|
||||
}
|
||||
main_widget->open_image_fd(*response.fd, *response.chosen_file);
|
||||
main_widget->open_image(response.value());
|
||||
} else {
|
||||
main_widget->create_default_image();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue