Mercurial > octave
changeset 24628:55da6c4f1382
update chdir handling in GUI
* main-window.cc (main_window::new_figure_callback):
Don't call octave_qt_link::update_directory here. This function
executes in the interpreter thread.
* octave-qt-link.cc (octave_qt_link::m_current_directory,
octave_qt_link::m_new_dir): Delete variables and all uses.
(octave_qt_link::update_directory): Delete function and all uses.
(octave_qt_link::do_change_directory): Don't store directory name
here. Simply emit change_directory_signal with the name of the new
directory.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 21 Jan 2018 17:33:20 -0500 |
parents | a79f782653ce |
children | 57f36275e605 |
files | libgui/src/main-window.cc libgui/src/octave-qt-link.cc libgui/src/octave-qt-link.h |
diffstat | 3 files changed, 4 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/main-window.cc Sat Jan 20 16:00:01 2018 -0500 +++ b/libgui/src/main-window.cc Sun Jan 21 17:33:20 2018 -0500 @@ -2622,8 +2622,9 @@ void main_window::change_directory_callback (const std::string& directory) { + // INTERPRETER THREAD + Fcd (ovl (directory)); - m_octave_qt_link->update_directory (); } void
--- a/libgui/src/octave-qt-link.cc Sat Jan 20 16:00:01 2018 -0500 +++ b/libgui/src/octave-qt-link.cc Sun Jan 21 17:33:20 2018 -0500 @@ -49,10 +49,7 @@ octave_qt_link::octave_qt_link (QWidget *, octave::gui_application *app_context) : octave_link (), m_app_context (app_context) -{ - m_current_directory = ""; - m_new_dir = true; -} +{ } bool octave_qt_link::do_confirm_shutdown (void) @@ -410,15 +407,7 @@ void octave_qt_link::do_change_directory (const std::string& dir) { - m_current_directory = QString::fromStdString (dir); - m_new_dir = true; -} - -void -octave_qt_link::update_directory () -{ - emit change_directory_signal (m_current_directory); - m_new_dir = false; + emit change_directory_signal (QString::fromStdString (dir)); } void @@ -435,9 +424,6 @@ if (! top_level && ! debug) return; - if (m_new_dir) - update_directory (); - QString scopes; QStringList symbols; QStringList class_names;
--- a/libgui/src/octave-qt-link.h Sat Jan 20 16:00:01 2018 -0500 +++ b/libgui/src/octave-qt-link.h Sun Jan 21 17:33:20 2018 -0500 @@ -107,8 +107,6 @@ void do_change_directory (const std::string& dir); - void update_directory (void); - void do_execute_command_in_terminal (const std::string& command); void do_set_workspace (bool top_level, bool debug, @@ -158,9 +156,6 @@ bool m_shutdown_confirm_result; - QString m_current_directory; - bool m_new_dir; - QMutex m_mutex; QWaitCondition m_waitcondition;