mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +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
1 changed files with 1 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue