# HG changeset patch # User John W. Eaton # Date 1365284772 14400 # Node ID c129a8b73d25cdf3b2a99e374d2ee3751cf88c02 # Parent 47fe533ec85ba6bf08d7a8d5931b876e01338b4e 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. diff --git a/libgui/src/main-window.cc b/libgui/src/main-window.cc --- 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 ()), diff --git a/libgui/src/main-window.h b/libgui/src/main-window.h --- 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 ();