Mercurial > octave
diff libgui/src/m-editor/file-editor-tab.cc @ 27651:c9ebcb9050b4
fix broken storing of editor session data at shutdown
* file-editor-tab.cc (closeEvent): do not emit ready to close signal here;
(check_modified_file): but here when closing was not canceled or file is
not modified
(do_save_file): and here after having saved the file
* file-editor.cc (check_closing): store number of tabs and connect their
signals for being ready to close with the related slot, if closing was
canceled, disconnect these signals;
(handle_tab_ready_to_close): immediately return from this slot
when closing was canceled
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Thu, 07 Nov 2019 10:03:25 +0100 |
parents | a18081db8fa3 |
children | bd7decacf32e |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc Wed Nov 06 18:18:51 2019 -0800 +++ b/libgui/src/m-editor/file-editor-tab.cc Thu Nov 07 10:03:25 2019 +0100 @@ -319,7 +319,6 @@ else { e->accept (); - emit tab_ready_to_close (); emit tab_remove_request (); } } @@ -1863,7 +1862,13 @@ if (decision == QMessageBox::Cancel) m_edit_area->setReadOnly (false); else if (decision == QMessageBox::Save) - save_file (m_file_name, remove, false); // Remove on success + save_file (m_file_name, remove, false); + else + emit tab_ready_to_close (); + } + else + { + emit tab_ready_to_close (); } return decision;