diff options
author | Lucas CHOLLET <lucas.chollet@free.fr> | 2023-01-14 19:03:55 -0500 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-02-16 10:56:01 +0000 |
commit | f9e3a591d2363a1518599362f797f75773dfcc49 (patch) | |
tree | 37bb5042187a26fd32c0d5a2082ad3a2845d52e8 /Userland | |
parent | b4cea1c72ec62bd5d48c6f2b0c74676792070414 (diff) | |
download | serenity-f9e3a591d2363a1518599362f797f75773dfcc49.zip |
3DFileViewer: Use `LibFSAC` in `GLContextWidget::load_path()`
It was the only function to not use the `LibFSAC`, it will allow us to:
- Not unveil some file
- Drop some tests on to-be-read-from file as they are performed in
`LibFSAC`.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Applications/3DFileViewer/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index cea5172399..86c78597b3 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -290,14 +290,14 @@ void GLContextWidget::timer_event(Core::TimerEvent&) bool GLContextWidget::load_path(DeprecatedString const& filename) { - auto file = Core::DeprecatedFile::construct(filename); + auto file = FileSystemAccessClient::Client::the().try_request_file_read_only_approved_deprecated(window(), filename); - if (!file->open(Core::OpenMode::ReadOnly) && file->error() != ENOENT) { + if (!file.is_error() && file.error().code() != ENOENT) { GUI::MessageBox::show(window(), DeprecatedString::formatted("Opening \"{}\" failed: {}", filename, strerror(errno)), "Error"sv, GUI::MessageBox::Type::Error); return false; } - return load_file(file); + return load_file(file.value()); } bool GLContextWidget::load_file(Core::DeprecatedFile& file) |