1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 23:58:11 +00:00

PixelPaint: Move saving a project from Image into ImageEditor

The ImageEditor knows more about the image than Image itself. So to save
a project with all the information known to the program about an image
it's logical that ImageEditor performs that task rather than the Image.

There isn't any additional data added yet, but now there's the
possibility to do so.
This commit is contained in:
Tobias Christiansen 2021-08-31 20:30:51 +02:00 committed by Andreas Kling
parent 60e526fdd2
commit e867e4b84b
5 changed files with 21 additions and 19 deletions

View file

@ -187,7 +187,7 @@ int main(int argc, char** argv)
auto save_result = FileSystemAccessClient::Client::the().save_file(window->window_id(), "untitled", "pp");
if (save_result.error != 0)
return;
auto result = editor->image().write_to_fd_and_close(*save_result.fd);
auto result = editor->save_project_to_fd_and_close(*save_result.fd);
if (result.is_error()) {
GUI::MessageBox::show_error(window, String::formatted("Could not save {}: {}", *save_result.chosen_file, result.error()));
return;