Mercurial > hg > octave-avbm
changeset 16451:c129a8b73d25
avoid unneeded signals for window focus
* main-window.h, main-windwo.cc (main_window::focus_command_window,
main_window::handle_command_double_clicked): Call command_window.focus
directly.
(main_window::focus_history_window): Delete.
(main_window::construct): Delete connection from
main_window::focus_command_window_signal to command_window::focus.
Connect history_action::triggered to history_window::focus instead of
main_window::focus_command_history.
(main_window::focus_command_window_signal
main_window::focus_history_window_signal): Delete signals.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 06 Apr 2013 17:46:12 -0400 |
parents | 47fe533ec85b |
children | 3207f1d62e74 |
files | libgui/src/main-window.cc libgui/src/main-window.h |
diffstat | 2 files changed, 11 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -90,6 +90,12 @@ } void +main_window::focus_command_window (void) +{ + command_window.focus (); +} + +void main_window::new_file () { #ifdef HAVE_QSCINTILLA @@ -157,7 +163,8 @@ main_window::handle_command_double_clicked (const QString& command) { emit relay_command_signal (command); - emit focus_command_window_signal (); + + command_window.focus (); } void @@ -340,18 +347,6 @@ } void -main_window::focus_command_window (void) -{ - emit focus_command_window_signal (); -} - -void -main_window::focus_history_window (void) -{ - emit focus_history_window_signal (); -} - -void main_window::focus_current_directory () { if (!_files_dock_widget->isVisible ()) @@ -1011,13 +1006,10 @@ connect (command_window_action, SIGNAL (triggered ()), &command_window, SLOT (focus ())); - connect (this, SIGNAL (focus_command_window_signal ()), - &command_window, SLOT (focus ())); - connect (workspace_action, SIGNAL (triggered ()), this, SLOT (focus_workspace ())); connect (history_action, SIGNAL (triggered ()), - this, SLOT (focus_command_history ())); + &history_window, SLOT (focus ())); connect (file_browser_action, SIGNAL (triggered ()), this, SLOT (focus_current_directory ())); connect (editor_action, SIGNAL (triggered ()),
--- a/libgui/src/main-window.h +++ b/libgui/src/main-window.h @@ -69,11 +69,11 @@ ~main_window (); + void focus_command_window (void); + signals: void settings_changed (const QSettings *); void relay_command_signal (const QString&); - void focus_command_window_signal (void); - void focus_history_window_signal (void); public slots: void report_status_message (const QString& statusMessage); @@ -103,8 +103,6 @@ void handle_command_double_clicked (const QString& command); - void focus_command_window (void); - void focus_history_window (void); void focus_current_directory (); void focus_workspace (); void focus_editor ();