1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:07:45 +00:00

LibFileSystemAccessClient+Userland: Return file paths as ByteStrings

Where it was straightforward to do so, I've updated the users to also
use ByteStrings for their file paths, but most of them have a temporary
String::from_byte_string() call instead.
This commit is contained in:
Sam Atkins 2024-01-23 16:05:59 +00:00 committed by Sam Atkins
parent 5a99a6afb4
commit 44ca55aaf8
23 changed files with 50 additions and 53 deletions

View file

@ -293,7 +293,7 @@ MainWidget::MainWidget()
}
set_path(file.filename());
GUI::Application::the()->set_most_recently_open_file(file.filename().to_byte_string());
GUI::Application::the()->set_most_recently_open_file(file.filename());
dbgln("Wrote document to {}", file.filename());
});
@ -799,11 +799,11 @@ void MainWidget::update_title()
window()->set_title(builder.to_byte_string());
}
ErrorOr<void> MainWidget::read_file(String const& filename, Core::File& file)
ErrorOr<void> MainWidget::read_file(ByteString const& filename, Core::File& file)
{
m_editor->set_text(TRY(file.read_until_eof()));
set_path(filename);
GUI::Application::the()->set_most_recently_open_file(filename.to_byte_string());
GUI::Application::the()->set_most_recently_open_file(filename);
m_editor->set_focus(true);
return {};
}