diff libgui/src/octave-qt-link.cc @ 20132:d7bea5b11fc3

only update file browser and dir selection box when on top-level (bug #44622) * main-window.cc (change_directory_callback): call function for updating gui * octave-qt-link.cc (octave_qt_link): init new variables _current_directory and _new_dir; (do_change_directory): only store current dir and new state, no gui update; (update_directory): new function updating gui and clearing new dir state; (do_set_workspace): when on top level and new dir state, update gui * octave-qt-link.h: new update function, new variables for dir and state
author Torsten <ttl@justmail.de>
date Sat, 25 Apr 2015 19:43:27 +0200
parents c36f2b083613
children 46fb763e5f3a
line wrap: on
line diff
--- a/libgui/src/octave-qt-link.cc	Sat Apr 25 13:18:02 2015 -0400
+++ b/libgui/src/octave-qt-link.cc	Sat Apr 25 19:43:27 2015 +0200
@@ -47,6 +47,9 @@
   : octave_link (), main_thread (new QThread ()),
     command_interpreter (new octave_interpreter ())
 {
+  _current_directory = "";
+  _new_dir = true;
+
   connect (this, SIGNAL (execute_interpreter_signal (void)),
            command_interpreter, SLOT (execute (void)));
 
@@ -431,7 +434,15 @@
 void
 octave_qt_link::do_change_directory (const std::string& dir)
 {
-  emit change_directory_signal (QString::fromStdString (dir));
+  _current_directory = QString::fromStdString (dir);
+  _new_dir = true;
+}
+
+void
+octave_qt_link::update_directory ()
+{
+   emit change_directory_signal (_current_directory);
+  _new_dir = false;
 }
 
 void
@@ -447,6 +458,9 @@
   if (! top_level && ! debug)
     return;
 
+  if (_new_dir)
+    update_directory ();
+
   QString scopes;
   QStringList symbols;
   QStringList class_names;