diff options
author | Karol Kosek <krkk@serenityos.org> | 2023-01-09 21:05:23 +0100 |
---|---|---|
committer | Jelle Raaijmakers <jelle@gmta.nl> | 2023-01-12 13:56:11 +0100 |
commit | ca7648b1ae25a3097ddf96eccf2048a26cdc3259 (patch) | |
tree | 58661cb1215f4e77bd600770d02e126c76a65e56 /Userland/Libraries | |
parent | 17012b266c06f4ca6c6210e63015ce5f849b50c7 (diff) | |
download | serenity-ca7648b1ae25a3097ddf96eccf2048a26cdc3259.zip |
LibGUI: Port AbstractThemePreview::set_theme_from_file to Core::Stream
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibGUI/AbstractThemePreview.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/AbstractThemePreview.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractThemePreview.cpp b/Userland/Libraries/LibGUI/AbstractThemePreview.cpp index d77fac7c51..581abb269d 100644 --- a/Userland/Libraries/LibGUI/AbstractThemePreview.cpp +++ b/Userland/Libraries/LibGUI/AbstractThemePreview.cpp @@ -85,9 +85,9 @@ void AbstractThemePreview::set_theme(Core::AnonymousBuffer const& theme_buffer) set_preview_palette(m_preview_palette); } -ErrorOr<void> AbstractThemePreview::set_theme_from_file(Core::File& file) +ErrorOr<void> AbstractThemePreview::set_theme_from_file(StringView path, NonnullOwnPtr<Core::Stream::File> file) { - auto config_file = TRY(Core::ConfigFile::open(file.filename(), file.leak_fd())); + auto config_file = TRY(Core::ConfigFile::open(path, move(file))); auto theme = TRY(Gfx::load_system_theme(config_file)); m_preview_palette = Gfx::Palette(Gfx::PaletteImpl::create_with_anonymous_buffer(theme)); diff --git a/Userland/Libraries/LibGUI/AbstractThemePreview.h b/Userland/Libraries/LibGUI/AbstractThemePreview.h index 66791a4605..5800262133 100644 --- a/Userland/Libraries/LibGUI/AbstractThemePreview.h +++ b/Userland/Libraries/LibGUI/AbstractThemePreview.h @@ -24,7 +24,7 @@ public: Gfx::Palette const& preview_palette() const { return m_preview_palette; } void set_preview_palette(Gfx::Palette const&); - ErrorOr<void> set_theme_from_file(Core::File&); + ErrorOr<void> set_theme_from_file(StringView path, NonnullOwnPtr<Core::Stream::File>); void set_theme(Core::AnonymousBuffer const&); void paint_window(StringView title, Gfx::IntRect const& rect, Gfx::WindowTheme::WindowState, Gfx::Bitmap const& icon, int button_count = 3); |