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

LibGUI: Reset TextEditor modified state on sucessful write_to_file

Avoids missing reset of the state if saving is done in multiple places.
This commit is contained in:
faxe1008 2021-05-16 21:30:46 +02:00 committed by Linus Groh
parent 3cafdca868
commit 2b24fbdaaa
2 changed files with 1 additions and 4 deletions

View file

@ -302,8 +302,6 @@ MainWidget::MainWidget()
GUI::MessageBox::show(window(), "Unable to save file.\n", "Error", GUI::MessageBox::Type::Error);
return;
}
editor().document().set_unmodified();
// FIXME: It would be cool if this would propagate from GUI::TextDocument somehow.
window()->set_modified(false);
@ -316,7 +314,6 @@ MainWidget::MainWidget()
if (!m_editor->write_to_file(m_path)) {
GUI::MessageBox::show(window(), "Unable to save file.\n", "Error", GUI::MessageBox::Type::Error);
} else {
editor().document().set_unmodified();
// FIXME: It would be cool if this would propagate from GUI::TextDocument somehow.
window()->set_modified(false);