1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 08:57:47 +00:00

LibFileSystemAccessClient: Rename try_* functions to try_*_deprecated

These functions return the deprecated `Core::File` class, so let's mark
it as such to avoid possible confusion between future non try_*
functions which will use Core::Stream family classes and to possibly
grab someone's attention. :^)
This commit is contained in:
Karol Kosek 2022-12-17 00:58:13 +01:00 committed by Sam Atkins
parent e361025cfb
commit 247db3fdd0
22 changed files with 38 additions and 38 deletions

View file

@ -238,7 +238,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
TRY(file_menu->try_add_action(GUI::CommonActions::make_open_action([&](auto&) {
if (request_close() == GUI::Window::CloseRequestDecision::StayOpen)
return;
auto response = FileSystemAccessClient::Client::the().try_open_file(&window, "Select theme file", "/res/themes"sv);
auto response = FileSystemAccessClient::Client::the().try_open_file_deprecated(&window, "Select theme file", "/res/themes"sv);
if (response.is_error())
return;
auto load_from_file_result = load_from_file(*response.value());
@ -250,7 +250,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
m_save_action = GUI::CommonActions::make_save_action([&](auto&) {
if (m_path.has_value()) {
auto result = FileSystemAccessClient::Client::the().try_request_file(&window, *m_path, Core::OpenMode::ReadWrite | Core::OpenMode::Truncate);
auto result = FileSystemAccessClient::Client::the().try_request_file_deprecated(&window, *m_path, Core::OpenMode::ReadWrite | Core::OpenMode::Truncate);
if (result.is_error())
return;
save_to_file(result.value());

View file

@ -170,7 +170,7 @@ void PreviewWidget::drop_event(GUI::DropEvent& event)
return;
}
auto response = FileSystemAccessClient::Client::the().try_request_file(window(), urls.first().path(), Core::OpenMode::ReadOnly);
auto response = FileSystemAccessClient::Client::the().try_request_file_deprecated(window(), urls.first().path(), Core::OpenMode::ReadOnly);
if (response.is_error())
return;

View file

@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
// Note: This is deferred to ensure that the window has already popped and thus proper window stealing can be performed.
app->event_loop().deferred_invoke(
[&window, &path, &main_widget]() {
auto response = FileSystemAccessClient::Client::the().try_request_file_read_only_approved(window, path.value());
auto response = FileSystemAccessClient::Client::the().try_request_file_read_only_approved_deprecated(window, path.value());
if (response.is_error())
GUI::MessageBox::show_error(window, DeprecatedString::formatted("Opening \"{}\" failed: {}", path.value(), response.error()));
else {