mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
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:
parent
40f9cf2de6
commit
3454185d08
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue