1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 12:27:35 +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

@ -168,7 +168,7 @@ NonnullRefPtr<GUI::Action> CalendarWidget::create_save_action(GUI::Action& save_
return;
}
auto response = FileSystemAccessClient::Client::the().request_file(window(), current_filename().to_byte_string(), Core::File::OpenMode::Write);
auto response = FileSystemAccessClient::Client::the().request_file(window(), current_filename(), Core::File::OpenMode::Write);
if (response.is_error())
return;

View file

@ -34,7 +34,7 @@ private:
void create_on_tile_doubleclick();
String const& current_filename() const { return m_event_calendar->event_manager().current_filename(); }
ByteString const& current_filename() const { return m_event_calendar->event_manager().current_filename(); }
void create_on_events_change();
NonnullRefPtr<GUI::Action> create_save_as_action();

View file

@ -30,8 +30,8 @@ class EventManager {
public:
static OwnPtr<EventManager> create();
String const& current_filename() const { return m_current_filename; }
void set_filename(String const& filename) { m_current_filename = filename; }
ByteString const& current_filename() const { return m_current_filename; }
void set_filename(ByteString filename) { m_current_filename = move(filename); }
ErrorOr<void> save(FileSystemAccessClient::File& file);
ErrorOr<void> load_file(FileSystemAccessClient::File& file);
@ -53,7 +53,7 @@ private:
Vector<Event> m_events;
bool m_dirty { false };
String m_current_filename;
ByteString m_current_filename;
};
}