1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

PixelPaint: Move title and path from Image to ImageEditor

As noted in the latest hacking video, it doesn't seem to make much
sense to store the title and path in the image itself. These fields
have now been moved to the actual ImageEditor itself.

This allows some nice simplicfications, including getting rid of the
`image_did_change_title` hook of ImageClient (which was just a way to
report back to the editor that the title had changed).
This commit is contained in:
Mustafa Quraish 2022-01-04 21:42:26 -05:00 committed by Andreas Kling
parent 0b43a92eed
commit 2440d2c2fe
6 changed files with 45 additions and 56 deletions

View file

@ -35,7 +35,6 @@ ErrorOr<void> ProjectLoader::try_load_from_fd_and_close(int fd, StringView path)
auto bitmap = TRY(Image::try_decode_bitmap(mapped_file->bytes()));
auto image = TRY(Image::try_create_from_bitmap(move(bitmap)));
image->set_path(path);
m_image = image;
return {};
}
@ -44,8 +43,6 @@ ErrorOr<void> ProjectLoader::try_load_from_fd_and_close(int fd, StringView path)
auto& json = json_or_error.value().as_object();
auto image = TRY(Image::try_create_from_pixel_paint_json(json));
image->set_path(path);
if (json.has("guides"))
m_json_metadata = json.get("guides").as_array();