# HG changeset patch # User Lachlan Andrew # Date 1455416165 -39600 # Node ID fc6a9bd59094b9fb5554668ef0a0b224d6e418da # Parent 7fbecef105caaa701a09f83b53240a25a2184632 backout changeset e8c3590da9ff diff -r 7fbecef105ca -r fc6a9bd59094 libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Fri Feb 19 21:27:03 2016 -0800 +++ b/libgui/src/m-editor/file-editor-tab.cc Sun Feb 14 13:16:05 2016 +1100 @@ -61,14 +61,14 @@ #include #include -#include "file-ops.h" - #include "resource-manager.h" #include "file-editor-tab.h" #include "file-editor.h" #include "octave-txt-lexer.h" #include "marker.h" +#include "file-ops.h" + #include "debug.h" #include "octave-qt-link.h" #include "version.h" @@ -87,15 +87,13 @@ */ // Make parent null for the file editor tab so that warning // WindowModal messages don't affect grandparents. -file_editor_tab::file_editor_tab (octave_dock_widget *editor, - const QString& directory_arg) +file_editor_tab::file_editor_tab (const QString& directory_arg) { _lexer_apis = 0; _is_octave_file = true; _lines_changed = false; _ced = directory_arg; - _main_win = static_cast (editor->parent ()); _file_name = ""; _file_system_watcher.setObjectName ("_qt_autotest_force_engine_poller"); @@ -335,7 +333,7 @@ // Ensure editor line numbers match Octave core's line numbers. // Give users the option to save modifications if necessary. if (! unchanged_or_saved () - || !(_main_win->get_octave_qt_link ()->file_in_path (info.file, info.dir))) + || !(octave_qt_link::file_in_path (info.file, info.dir))) return; // Search for previous condition. FIXME -- is there a more direct way? @@ -929,7 +927,7 @@ bp_table::intmap line_info; line_info[0] = info.line; - if (_main_win->get_octave_qt_link ()->file_in_path (info.file, info.dir)) + if (octave_qt_link::file_in_path (info.file, info.dir)) bp_table::add_breakpoint (info.function_name, line_info, info.condition); } @@ -939,14 +937,14 @@ bp_table::intmap line_info; line_info[0] = info.line; - if (_main_win->get_octave_qt_link ()->file_in_path (info.file, info.dir)) + if (octave_qt_link::file_in_path (info.file, info.dir)) bp_table::remove_breakpoint (info.function_name, line_info); } void file_editor_tab::remove_all_breakpoints_callback (const bp_info& info) { - if (_main_win->get_octave_qt_link ()->file_in_path (info.file, info.dir)) + if (octave_qt_link::file_in_path (info.file, info.dir)) bp_table::remove_all_breakpoints_in_file (info.function_name, true); } diff -r 7fbecef105ca -r fc6a9bd59094 libgui/src/m-editor/file-editor-tab.h --- a/libgui/src/m-editor/file-editor-tab.h Fri Feb 19 21:27:03 2016 -0800 +++ b/libgui/src/m-editor/file-editor-tab.h Sun Feb 14 13:16:05 2016 +1100 @@ -43,7 +43,6 @@ #include "find-dialog.h" #include "octave-qscintilla.h" #include "builtin-defun-decls.h" -#include "main-window.h" #include "marker.h" /* Only needed for typedef of "QIntList", which may be typedefed elsewhere. Could use common location. */ @@ -57,7 +56,7 @@ public: - file_editor_tab (octave_dock_widget *editor, const QString& directory = ""); + file_editor_tab (const QString& directory = ""); ~file_editor_tab (void); @@ -258,7 +257,6 @@ void update_eol_indicator (); octave_qscintilla *_edit_area; - main_window *_main_win; QStatusBar *_status_bar; QLabel *_row_indicator; diff -r 7fbecef105ca -r fc6a9bd59094 libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Fri Feb 19 21:27:03 2016 -0800 +++ b/libgui/src/m-editor/file-editor.cc Sun Feb 14 13:16:05 2016 +1100 @@ -201,7 +201,7 @@ // editor tab has yet to be created and there is no object to // pass a signal to. Hence, functionality is here. - file_editor_tab *fileEditorTab = new file_editor_tab (this, ced); + file_editor_tab *fileEditorTab = new file_editor_tab (ced); if (fileEditorTab) { add_file_editor_tab (fileEditorTab, ""); // new tab with empty title @@ -454,7 +454,7 @@ } else { - file_editor_tab *fileEditorTab = new file_editor_tab (this); + file_editor_tab *fileEditorTab = new file_editor_tab (); if (fileEditorTab) { fileEditorTab->set_encoding (encoding); diff -r 7fbecef105ca -r fc6a9bd59094 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Fri Feb 19 21:27:03 2016 -0800 +++ b/libgui/src/main-window.cc Sun Feb 14 13:16:05 2016 +1100 @@ -338,7 +338,7 @@ void main_window::run_file_callback (const QFileInfo& info) { - octave_cmd_eval *cmd = new octave_cmd_eval (info, _octave_qt_link); + octave_cmd_eval *cmd = new octave_cmd_eval (info); _cmd_queue.add_cmd (cmd); } diff -r 7fbecef105ca -r fc6a9bd59094 libgui/src/main-window.h --- a/libgui/src/main-window.h Fri Feb 19 21:27:03 2016 -0800 +++ b/libgui/src/main-window.h Sun Feb 14 13:16:05 2016 +1100 @@ -82,8 +82,6 @@ void focus_command_window (void); - octave_qt_link* get_octave_qt_link () { return _octave_qt_link; }; - signals: void active_dock_changed (octave_dock_widget *, octave_dock_widget *); diff -r 7fbecef105ca -r fc6a9bd59094 libgui/src/octave-cmd.cc --- a/libgui/src/octave-cmd.cc Fri Feb 19 21:27:03 2016 -0800 +++ b/libgui/src/octave-cmd.cc Sun Feb 14 13:16:05 2016 +1100 @@ -33,7 +33,6 @@ #include "builtin-defun-decls.h" #include "utils.h" -#include "main-window.h" // --------------------------------------------------------------------- // class octave_cmd_exec: executing a command @@ -66,7 +65,7 @@ { // valid identifier: call as function with possibility to debug std::string path = _info.absolutePath ().toStdString (); - if (_octave_qt_link->file_in_path (file_path, path)) + if (octave_qt_link::file_in_path (file_path, path)) command_editor::replace_line (function_name.toStdString ()); } else diff -r 7fbecef105ca -r fc6a9bd59094 libgui/src/octave-cmd.h --- a/libgui/src/octave-cmd.h Fri Feb 19 21:27:03 2016 -0800 +++ b/libgui/src/octave-cmd.h Sun Feb 14 13:16:05 2016 +1100 @@ -66,18 +66,12 @@ { public: - octave_cmd_eval (const QFileInfo& info, - octave_qt_link* octave_qt_link) : octave_cmd () - { _info = info; - _octave_qt_link = octave_qt_link; - }; - + octave_cmd_eval (const QFileInfo& info) : octave_cmd () { _info = info; }; void execute (); protected: QFileInfo _info; - octave_qt_link *_octave_qt_link; }; diff -r 7fbecef105ca -r fc6a9bd59094 libgui/src/octave-qt-link.cc --- a/libgui/src/octave-qt-link.cc Fri Feb 19 21:27:03 2016 -0800 +++ b/libgui/src/octave-qt-link.cc Sun Feb 14 13:16:05 2016 +1100 @@ -610,7 +610,6 @@ { case 1: Fcd (ovl (dir)); - update_directory (); ok = true; break; diff -r 7fbecef105ca -r fc6a9bd59094 libgui/src/octave-qt-link.h --- a/libgui/src/octave-qt-link.h Fri Feb 19 21:27:03 2016 -0800 +++ b/libgui/src/octave-qt-link.h Sun Feb 14 13:16:05 2016 +1100 @@ -130,7 +130,7 @@ void do_set_default_prompts (std::string& ps1, std::string& ps2, std::string& ps4); - bool file_in_path (const std::string& file, const std::string& dir); + static bool file_in_path (const std::string& file, const std::string& dir); void do_show_preferences (void);