Mercurial > octave
diff libgui/src/m-editor/file-editor-tab.h @ 30745:2f6904439d3c
fix updating the name of renamed editor files
* files-dock-widget.cc (contextmenu_delete): emit file_renamed_signal
in nay case, not only on errors while deleting the file
* file-editor-tab.cc (set_file_name): update window title here;
(enable_file_watcher): new function for en-/disabling the file
watcher for the current file;
(load_file): set modified state before setting the file name,
do not set window title, which is done in set_file_name;
(do_save_file): dito
* file-editor-tab.h: new function enable_file_watcher,
function set_file_name public
* file-editor.cc (handle_file_remove): use removed_file_data instead
of session_data, only disable file watching and remember editor tab
and new file name;
(handle_file_renamed): if succesfully renamed/removed, update the
file name or close the file, otherwise just re-enable file watcher
(handle_dir_remove): use removed_file_data, disable file watcher,
remember editor tab and new file name
* file-editor.h: new struct removed_file_data, m_tmp_closed_files
is of type removed_file_data
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Tue, 15 Feb 2022 18:57:16 +0100 |
parents | 796f54d4ddbf |
children | c6c4c6f04170 |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.h Tue Feb 15 11:57:26 2022 -0500 +++ b/libgui/src/m-editor/file-editor-tab.h Tue Feb 15 18:57:16 2022 +0100 @@ -64,6 +64,8 @@ bool conditional_close (void); void update_breakpoints (); + void set_file_name (const QString& fileName); + void enable_file_watcher (bool do_enable); QString file_name (void) const { return m_file_name; } QString encoding (void) const { return m_encoding; } @@ -255,7 +257,6 @@ protected: void closeEvent (QCloseEvent *event); - void set_file_name (const QString& fileName); private: