diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-02-09 03:02:46 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-13 00:50:07 +0000 |
commit | 606a3982f34d777f121fcc4aa964141199676c20 (patch) | |
tree | 836fef41d11f1b77f4dac7d699e5c9f720ee4ff1 /Userland/Applications/ThemeEditor | |
parent | a96339b72b3b417ffaa4fbb4e7575149f749acaa (diff) | |
download | serenity-606a3982f34d777f121fcc4aa964141199676c20.zip |
LibCore: Move Stream-based file into the `Core` namespace
Diffstat (limited to 'Userland/Applications/ThemeEditor')
-rw-r--r-- | Userland/Applications/ThemeEditor/MainWidget.cpp | 12 | ||||
-rw-r--r-- | Userland/Applications/ThemeEditor/MainWidget.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Userland/Applications/ThemeEditor/MainWidget.cpp b/Userland/Applications/ThemeEditor/MainWidget.cpp index ff4e6453dd..b80dcb5ffe 100644 --- a/Userland/Applications/ThemeEditor/MainWidget.cpp +++ b/Userland/Applications/ThemeEditor/MainWidget.cpp @@ -250,12 +250,12 @@ 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().request_file(&window, *m_path, Core::Stream::OpenMode::ReadWrite | Core::Stream::OpenMode::Truncate); + auto result = FileSystemAccessClient::Client::the().request_file(&window, *m_path, Core::File::OpenMode::ReadWrite | Core::File::OpenMode::Truncate); if (result.is_error()) return; save_to_file(result.value().filename(), result.value().release_stream()); } else { - auto result = FileSystemAccessClient::Client::the().save_file(&window, "Theme", "ini", Core::Stream::OpenMode::ReadWrite | Core::Stream::OpenMode::Truncate); + auto result = FileSystemAccessClient::Client::the().save_file(&window, "Theme", "ini", Core::File::OpenMode::ReadWrite | Core::File::OpenMode::Truncate); if (result.is_error()) return; save_to_file(result.value().filename(), result.value().release_stream()); @@ -264,7 +264,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) TRY(file_menu->try_add_action(*m_save_action)); TRY(file_menu->try_add_action(GUI::CommonActions::make_save_as_action([&](auto&) { - auto result = FileSystemAccessClient::Client::the().save_file(&window, "Theme", "ini", Core::Stream::OpenMode::ReadWrite | Core::Stream::OpenMode::Truncate); + auto result = FileSystemAccessClient::Client::the().save_file(&window, "Theme", "ini", Core::File::OpenMode::ReadWrite | Core::File::OpenMode::Truncate); if (result.is_error()) return; save_to_file(result.value().filename(), result.value().release_stream()); @@ -315,7 +315,7 @@ void MainWidget::set_path(DeprecatedString path) update_title(); } -void MainWidget::save_to_file(String const& filename, NonnullOwnPtr<Core::Stream::File> file) +void MainWidget::save_to_file(String const& filename, NonnullOwnPtr<Core::File> file) { auto theme = Core::ConfigFile::open(filename.to_deprecated_string(), move(file)).release_value_but_fixme_should_propagate_errors(); @@ -601,7 +601,7 @@ void MainWidget::show_path_picker_dialog(StringView property_display_name, GUI:: path_input.set_text(*result); } -ErrorOr<void> MainWidget::load_from_file(String const& filename, NonnullOwnPtr<Core::Stream::File> file) +ErrorOr<void> MainWidget::load_from_file(String const& filename, NonnullOwnPtr<Core::File> file) { auto config_file = TRY(Core::ConfigFile::open(filename.to_deprecated_string(), move(file))); auto theme = TRY(Gfx::load_system_theme(config_file)); @@ -669,7 +669,7 @@ void MainWidget::drop_event(GUI::DropEvent& event) if (request_close() == GUI::Window::CloseRequestDecision::StayOpen) return; - 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; diff --git a/Userland/Applications/ThemeEditor/MainWidget.h b/Userland/Applications/ThemeEditor/MainWidget.h index d33155de80..287a165b04 100644 --- a/Userland/Applications/ThemeEditor/MainWidget.h +++ b/Userland/Applications/ThemeEditor/MainWidget.h @@ -86,7 +86,7 @@ public: ErrorOr<void> initialize_menubar(GUI::Window&); GUI::Window::CloseRequestDecision request_close(); void update_title(); - ErrorOr<void> load_from_file(String const& filename, NonnullOwnPtr<Core::Stream::File> file); + ErrorOr<void> load_from_file(String const& filename, NonnullOwnPtr<Core::File> file); private: explicit MainWidget(NonnullRefPtr<AlignmentModel>); @@ -94,7 +94,7 @@ private: virtual void drag_enter_event(GUI::DragEvent&) override; virtual void drop_event(GUI::DropEvent&) override; - void save_to_file(String const& filename, NonnullOwnPtr<Core::Stream::File> file); + void save_to_file(String const& filename, NonnullOwnPtr<Core::File> file); ErrorOr<Core::AnonymousBuffer> encode(); void set_path(DeprecatedString); |