From 95a03f8ed6d737e602b5446ed7ce847e57f93966 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sat, 14 Jan 2023 19:32:16 -0500 Subject: [PATCH] 3DFileViewer: Don't try to open textures without `LibFSASC` --- Userland/Applications/3DFileViewer/main.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index 0f8b2e38f9..96c5a6fd9d 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -318,22 +318,14 @@ bool GLContextWidget::load_file(String const& filename, NonnullOwnPtr texture_image; - if (Core::DeprecatedFile::exists(texture_path)) { - auto bitmap_or_error = Gfx::Bitmap::load_from_file(texture_path); + auto response = FileSystemAccessClient::Client::the().request_file_read_only_approved(window(), builder.string_view()); + if (!response.is_error()) { + auto texture_file = response.release_value(); + auto bitmap_or_error = Gfx::Bitmap::load_from_file(texture_file.release_stream(), texture_file.filename()); if (!bitmap_or_error.is_error()) texture_image = bitmap_or_error.release_value_but_fixme_should_propagate_errors(); - } else { - auto response = FileSystemAccessClient::Client::the().request_file_read_only_approved(window(), builder.string_view()); - if (!response.is_error()) { - auto texture_file = response.release_value(); - auto bitmap_or_error = Gfx::Bitmap::load_from_file(texture_file.release_stream(), texture_file.filename()); - if (!bitmap_or_error.is_error()) - texture_image = bitmap_or_error.release_value_but_fixme_should_propagate_errors(); - } } GLuint tex;