PixelPaint: Don't crash when cancel is pressed when saving a file

Previously, we were attempting to add an empty string to the most
recently open files list when no file was saved.
This commit is contained in:
Tim Ledbetter 2024-02-09 05:55:02 +00:00 committed by Jelle Raaijmakers
commit ad62e433f0
Notes: sideshowbarker 2024-07-17 06:38:11 +09:00
3 changed files with 9 additions and 2 deletions

View file

@ -763,6 +763,8 @@ void ImageEditor::save_project()
return;
}
set_unmodified();
if (on_file_saved)
on_file_saved(path());
}
void ImageEditor::save_project_as()
@ -779,6 +781,8 @@ void ImageEditor::save_project_as()
set_path(file.filename());
set_loaded_from_image(false);
set_unmodified();
if (on_file_saved)
on_file_saved(path());
}
ErrorOr<void> ImageEditor::save_project_to_file(NonnullOwnPtr<Core::File> file) const