diff libgui/src/m-editor/file-editor.cc @ 15425:8ae34ffe5c1b

Retain QsciAPIs lexer_api as part of lexer_octave_gui object (bug #37359) This way, it may be deleted upon deconstruction and not cause segmentation fault at startup * file-editor-tab.cc, file-editor-tab.h (file_editor_tab::update_tracked_file): Delete. (file_editor_tab::set_file_name): Rather than clear whole list, just subtract out the old file name then add the new name. (file_editor_tab::load_file): Remove update_tracked_file, it's part of set_file_name. (file_editor_tab::file_has_changed): Remove update_tracked_file, it's part of set_file_name. (file_editor_tab::save_file): Move file close before set_file_name so watcher doesn't notice. Remove inelegant code that solved this by clearing watcher files. * lexer-octave-gui.cc, file-editor-tab.cc (file_editor_tab::update_lexer, lexer_octave_gui::lexer_octave_gui, lexer_octave_gui : public QsciLexer): Move all the lexer preparatory code to the constructor so that lexer_api can be retained as part of object. (lexer_octave_gui::~lexer_octave_gui): Make destructor non-virtual and delete lexer_gui when done. * octave-gui.cc, main-window-h, main-window.cc, file-editor.cc (octave_start_gui, file_editor::construct): Move read_settings from constructor to after construction in octave_start_gui so that no signal occur referencing a partially constructed object. * file-editor.cc (file_editor::construct): Tidy code.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Thu, 20 Sep 2012 04:08:53 -0500
parents f918db8102d5
children bbbb89cc338f
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc	Tue Sep 18 00:40:16 2012 -0400
+++ b/libgui/src/m-editor/file-editor.cc	Thu Sep 20 04:08:53 2012 -0500
@@ -594,8 +594,8 @@
     {
       QStringList sessionFileNames = settings->value("editor/savedSessionTabs", QStringList()).toStringList ();
 
-      for (int n=0;n<sessionFileNames.count();++n)
-        request_open_file(sessionFileNames.at(n), true);
+      for (int n=0; n < sessionFileNames.count (); ++n)
+        request_open_file (sessionFileNames.at (n), true);
     }
 }