changeset 29600:b909a8915a72

avoid connecting to parent slots in history dock widget * main-window.cc (main_window::main_window): Make connections from history dock widget signals to main window slots here. * history-dock-widget.cc (history_dock_widget::history_dock_widget): Not here.
author John W. Eaton <jwe@octave.org>
date Mon, 03 May 2021 16:45:00 -0400
parents 2b5bc8367135
children eaf0943b7361
files libgui/src/history-dock-widget.cc libgui/src/main-window.cc
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/history-dock-widget.cc	Mon May 03 16:40:37 2021 -0400
+++ b/libgui/src/history-dock-widget.cc	Mon May 03 16:45:00 2021 -0400
@@ -52,15 +52,6 @@
   {
     setStatusTip (tr ("Browse and search the command history."));
 
-    connect (this, SIGNAL (command_create_script (const QString&)),
-             p, SIGNAL (new_file_signal (const QString&)));
-
-    connect (this, SIGNAL (information (const QString&)),
-             p, SLOT (report_status_message (const QString&)));
-
-    connect (this, SIGNAL (command_double_clicked (const QString&)),
-             p, SLOT (execute_command_in_terminal (const QString&)));
-
     construct ();
   }
 
--- a/libgui/src/main-window.cc	Mon May 03 16:40:37 2021 -0400
+++ b/libgui/src/main-window.cc	Mon May 03 16:45:00 2021 -0400
@@ -168,6 +168,15 @@
 
     m_history_window = new history_dock_widget (this, m_octave_qobj);
 
+    connect (m_history_window, &history_dock_widget::command_create_script,
+             this, &main_window::new_file_signal);
+
+    connect (m_history_window, &history_dock_widget::information,
+             this, &main_window::report_status_message);
+
+    connect (m_history_window, &history_dock_widget::command_double_clicked,
+             this, &main_window::execute_command_in_terminal);
+
     m_file_browser_window = new files_dock_widget (this, m_octave_qobj);
     connect (m_file_browser_window, &files_dock_widget::open_file,
              this, QOverload<const QString&>::of (&main_window::open_file_signal));