TextEditor: Use request_file_read_only_approved for the drop event

This allows TextEditor to open the file without asking for user consent.
This commit is contained in:
Lucas CHOLLET 2023-01-14 17:47:37 -05:00 committed by Jelle Raaijmakers
parent 40f9cf2de6
commit 3454185d08

View file

@ -806,8 +806,7 @@ void MainWidget::drop_event(GUI::DropEvent& event)
if (!request_close())
return;
// TODO: A drop event should be considered user consent for opening a file
auto response = FileSystemAccessClient::Client::the().request_file(window(), urls.first().path(), Core::Stream::OpenMode::Read);
auto response = FileSystemAccessClient::Client::the().request_file_read_only_approved(window(), urls.first().path());
if (response.is_error())
return;
read_file(response.value().filename(), response.value().stream());