diff options
author | Mustafa Quraish <mustafaq9@gmail.com> | 2022-01-16 03:41:34 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-20 10:39:12 +0100 |
commit | aae96af8120dec103d0bbd781d6e52ec07104305 (patch) | |
tree | 54fdf64558f638b9531a54d37e4f7aef6196116e /Userland/Applications/HexEditor/HexEditor.cpp | |
parent | 0c98e553e8a49b5fdbee21c4520ee3547e14061d (diff) | |
download | serenity-aae96af8120dec103d0bbd781d6e52ec07104305.zip |
HexEditor: Use FileSystemAccessClient::try_* APIs
Diffstat (limited to 'Userland/Applications/HexEditor/HexEditor.cpp')
-rw-r--r-- | Userland/Applications/HexEditor/HexEditor.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Userland/Applications/HexEditor/HexEditor.cpp b/Userland/Applications/HexEditor/HexEditor.cpp index fefb21ef0b..e6da87403e 100644 --- a/Userland/Applications/HexEditor/HexEditor.cpp +++ b/Userland/Applications/HexEditor/HexEditor.cpp @@ -115,13 +115,8 @@ void HexEditor::set_position(size_t position) update_status(); } -bool HexEditor::save_as(int fd) +bool HexEditor::save_as(NonnullRefPtr<Core::File> new_file) { - auto new_file = Core::File::construct(); - if (!new_file->open(fd, Core::OpenMode::ReadWrite, Core::File::ShouldCloseFileDescriptor::Yes)) { - return false; - } - if (m_document->type() == HexDocument::Type::File) { HexDocumentFile* fileDocument = static_cast<HexDocumentFile*>(m_document.ptr()); if (!fileDocument->write_to_file(new_file)) |