Mercurial > hg > octave-lojdl
changeset 16424:ad052cdc89ad
use signal for octave_link::edit_file
* main-window.h, main-window.cc
(main_window::handle_edit_file_request): Delete.
(main_window::construct): Delete signal connection from
_octave_qt_event_listener::edit_file_signal to
main_window::handle_edit_file_request.
Connect _octave_qt_link::edit_file_signal to
_file_editor::handle_edit_file_request.
* qt-event-listener.h, qt-event-listener.cc
(octave_qt_event_listener::edit_file): Delete.
(octave_qt_event_listener::edit_file_signal): Delete.
* octave-qt-link.cc (octave_qt_link::do_edit_file): Emit signal
instead of using event listener.
* octave-qt-link.h (octave_qt_link::edit_file_signal): New signal.
* octave-event-listener.h (octave_event_listener::edit_file): Delete.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 04 Apr 2013 01:43:18 -0400 |
parents | 04c4dd7fd3ce |
children | 8ff9006cedc3 |
files | libgui/src/main-window.cc libgui/src/main-window.h libgui/src/octave-qt-event-listener.cc libgui/src/octave-qt-event-listener.h libgui/src/octave-qt-link.cc libgui/src/octave-qt-link.h libinterp/interp-core/octave-event-listener.h |
diffstat | 7 files changed, 9 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -520,14 +520,6 @@ } void -main_window::handle_edit_file_request (const QString& file) -{ -#ifdef HAVE_QSCINTILLA - _file_editor->handle_edit_file_request (file); -#endif -} - -void main_window::debug_continue () { octave_link::post_event (this, &main_window::debug_continue_callback); @@ -1205,11 +1197,6 @@ this, SLOT (handle_update_dbstop_marker_request (bool, const QString&, int))); - connect (_octave_qt_event_listener, - SIGNAL (edit_file_signal (const QString&)), - this, - SLOT (handle_edit_file_request(const QString&))); - // FIXME -- is it possible to eliminate the event_listenter? _octave_qt_link = new octave_qt_link (); @@ -1219,6 +1206,11 @@ _file_editor, SLOT (handle_update_dbstop_marker_request (bool, const QString&, int))); + connect (_octave_qt_link, + SIGNAL (edit_file_signal (const QString&)), + _file_editor, + SLOT (handle_edit_file_request (const QString&))); + octave_link::connect_link (_octave_qt_link); octave_link::register_event_listener (_octave_qt_event_listener);
--- a/libgui/src/main-window.h +++ b/libgui/src/main-window.h @@ -111,7 +111,6 @@ void handle_insert_debugger_pointer_request (const QString& file, int line); void handle_delete_debugger_pointer_request (const QString& file, int line); void handle_update_dbstop_marker_request (bool insert, const QString& file, int line); - void handle_edit_file_request (const QString& file); void debug_continue (); void debug_step_into (); void debug_step_over ();
--- a/libgui/src/octave-qt-event-listener.cc +++ b/libgui/src/octave-qt-event-listener.cc @@ -77,12 +77,6 @@ } void -octave_qt_event_listener::edit_file (const std::string& file) -{ - emit edit_file_signal (QString::fromStdString (file)); -} - -void octave_qt_event_listener::about_to_exit () { qApp->quit ();
--- a/libgui/src/octave-qt-event-listener.h +++ b/libgui/src/octave-qt-event-listener.h @@ -40,7 +40,6 @@ void insert_debugger_pointer (const std::string& file, int line); void delete_debugger_pointer (const std::string& file, int line); void update_dbstop_marker (bool insert, const std::string& file, int line); - void edit_file (const std::string& file); void about_to_exit (); void entered_debug_mode (); @@ -53,7 +52,6 @@ void insert_debugger_pointer_signal (const QString& file, int line); void delete_debugger_pointer_signal (const QString& file, int line); void update_dbstop_marker_signal (bool insert, const QString& file, int line); - void edit_file_signal (const QString& file); void entered_debug_mode_signal (); void quit_debug_mode_signal (); };
--- a/libgui/src/octave-qt-link.cc +++ b/libgui/src/octave-qt-link.cc @@ -113,16 +113,7 @@ bool octave_qt_link::do_edit_file (const std::string& file) { - bool retval = false; - - if (event_listener) - { - event_listener->edit_file (file); + emit edit_file_signal (QString::fromStdString (file)); - do_process_events (); - - retval = true; - } - - return retval; + return true; }
--- a/libgui/src/octave-qt-link.h +++ b/libgui/src/octave-qt-link.h @@ -82,6 +82,8 @@ signals: void update_dbstop_marker_signal (bool insert, const QString& file, int line); + + void edit_file_signal (const QString& file); }; #endif
--- a/libinterp/interp-core/octave-event-listener.h +++ b/libinterp/interp-core/octave-event-listener.h @@ -49,8 +49,6 @@ virtual void update_dbstop_marker (bool insert, const std::string& file, int line) = 0; - virtual void edit_file (const std::string& file) = 0; - virtual void about_to_exit () = 0; virtual void entered_debug_mode () = 0;