1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibCore: Move Stream-based file into the Core namespace

This commit is contained in:
Tim Schumacher 2023-02-09 03:02:46 +01:00 committed by Linus Groh
parent a96339b72b
commit 606a3982f3
218 changed files with 748 additions and 643 deletions

View file

@ -121,7 +121,7 @@ HexEditorWidget::HexEditorWidget()
if (!request_close())
return;
auto response = FileSystemAccessClient::Client::the().open_file(window(), {}, Core::StandardPaths::home_directory(), Core::Stream::OpenMode::ReadWrite);
auto response = FileSystemAccessClient::Client::the().open_file(window(), {}, Core::StandardPaths::home_directory(), Core::File::OpenMode::ReadWrite);
if (response.is_error())
return;
@ -142,7 +142,7 @@ HexEditorWidget::HexEditorWidget()
});
m_save_as_action = GUI::CommonActions::make_save_as_action([&](auto&) {
auto response = FileSystemAccessClient::Client::the().save_file(window(), m_name, m_extension, Core::Stream::OpenMode::ReadWrite | Core::Stream::OpenMode::Truncate);
auto response = FileSystemAccessClient::Client::the().save_file(window(), m_name, m_extension, Core::File::OpenMode::ReadWrite | Core::File::OpenMode::Truncate);
if (response.is_error())
return;
auto file = response.release_value();
@ -525,7 +525,7 @@ void HexEditorWidget::update_title()
window()->set_title(builder.to_deprecated_string());
}
void HexEditorWidget::open_file(String const& filename, NonnullOwnPtr<Core::Stream::File> file)
void HexEditorWidget::open_file(String const& filename, NonnullOwnPtr<Core::File> file)
{
window()->set_modified(false);
m_editor->open_file(move(file));
@ -586,7 +586,7 @@ void HexEditorWidget::drop_event(GUI::DropEvent& event)
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(window(), urls.first().path(), Core::File::OpenMode::Read);
if (response.is_error())
return;
open_file(response.value().filename(), response.value().release_stream());