changeset 15155:9e62d5a3a45e gui

partial cleanup of include files in gui sources * symbol-information.cc, octave-adapter/octave-event.cc: New files. * documentation-dockwidget.h, history-dockwidget.cc, m-editor/file-editor.h, octave-event.cc, octave-event.h, octave-link.cc, octave-link.h, octave-main-thread.cc, octave-gui.cc, symbol-information.cc, symbol-information.h, workspace-model.cc: Avoid including unnecssary header files.
author John W. Eaton <jwe@octave.org>
date Sat, 11 Aug 2012 11:02:12 -0400
parents d8a10cae1dcd
children 141b0b108292
files gui/src/Makefile.am gui/src/documentation-dockwidget.h gui/src/history-dockwidget.cc gui/src/m-editor/file-editor.h gui/src/octave-adapter/octave-event.cc gui/src/octave-adapter/octave-event.h gui/src/octave-adapter/octave-link.cc gui/src/octave-adapter/octave-link.h gui/src/octave-adapter/octave-main-thread.cc gui/src/octave-gui.cc gui/src/symbol-information.cc gui/src/symbol-information.h gui/src/workspace-model.cc
diffstat 13 files changed, 353 insertions(+), 264 deletions(-) [+]
line wrap: on
line diff
--- a/gui/src/Makefile.am	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/Makefile.am	Sat Aug 11 11:02:12 2012 -0400
@@ -48,6 +48,7 @@
 		     octave-qt-event-listener.cc \
 		     resource-manager.cc \
 		     settings-dialog.cc \
+		     symbol-information.cc \
 		     terminal-dockwidget.cc \
 		     welcome-wizard.cc \
 		     workspace-model.cc \
@@ -56,6 +57,7 @@
 		     m-editor/file-editor-tab.cc \
 		     m-editor/find-dialog.cc \
 		     m-editor/lexer-octave-gui.cc \
+		     octave-adapter/octave-event.cc \
 		     octave-adapter/octave-link.cc \
 		     octave-adapter/octave-main-thread.cc \
 		     qtinfo/parser.cc \
--- a/gui/src/documentation-dockwidget.h	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/documentation-dockwidget.h	Sat Aug 11 11:02:12 2012 -0400
@@ -18,6 +18,7 @@
 #ifndef DOCUMENTATIONDOCKWIDGET_H
 #define DOCUMENTATIONDOCKWIDGET_H
 
+#include <QObject>
 #include <QDockWidget>
 #include "webinfo.h"
 
--- a/gui/src/history-dockwidget.cc	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/history-dockwidget.cc	Sat Aug 11 11:02:12 2012 -0400
@@ -15,8 +15,15 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <QVBoxLayout>
+
+#include "cmd-hist.h"
+
 #include "history-dockwidget.h"
-#include <QVBoxLayout>
 
 history_dock_widget::history_dock_widget (QWidget * parent)
   : QDockWidget (parent), octave_event_observer ()
--- a/gui/src/m-editor/file-editor.h	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/m-editor/file-editor.h	Sat Aug 11 11:02:12 2012 -0400
@@ -18,10 +18,6 @@
 #ifndef FILEEDITORMDISUBWINDOW_H
 #define FILEEDITORMDISUBWINDOW_H
 
-#include "main-window.h"
-#include "file-editor-interface.h"
-#include "file-editor-tab.h"
-
 #include <QToolBar>
 #include <QAction>
 #include <QMenuBar>
@@ -29,6 +25,10 @@
 #include <QCloseEvent>
 #include <QTabWidget>
 
+#include "main-window.h"
+#include "file-editor-interface.h"
+#include "file-editor-tab.h"
+
 const char UNNAMED_FILE[]     = "<unnamed>";
 const char SAVE_FILE_FILTER[] = "Octave Files (*.m);;All Files (*.*)";
 enum editor_markers
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/octave-adapter/octave-event.cc	Sat Aug 11 11:02:12 2012 -0400
@@ -0,0 +1,170 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 John P. Swensen, Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string>
+
+#include "cmd-hist.h"
+#include "oct-env.h"
+
+#include "debug.h"
+#include "oct-obj.h"
+#include "parse.h"
+#include "symtab.h"
+#include "toplev.h"
+
+#include "octave-event.h"
+
+#include <readline/readline.h>
+
+void
+octave_event::call_octave_function (std::string name)
+{
+  call_octave_function (name, octave_value_list ());
+}
+
+void
+octave_event::call_octave_function (std::string name,
+                                    const octave_value_list& args,
+                                    int nargout)
+{
+  try
+    {
+      feval (name, args, nargout);
+    } catch (...) { } // Ignore exceptions. Crashes without that.
+}
+
+void
+octave_event::finish_readline_event () const
+{
+  rl_line_buffer[0] = '\0';
+  rl_point = rl_end = 0;
+  rl_done = 1;
+  //rl_forced_update_display ();
+}
+
+bool
+octave_clear_history_event::perform ()
+{
+  int i;
+  while ((i = command_history::length ()) > 0) {
+    command_history::remove (i - 1);
+  }
+  return true;
+}
+
+bool
+octave_debug_step_into_event::perform ()
+{
+  octave_value_list args;
+  args.append (octave_value ("in"));
+  call_octave_function ("dbstep", args);
+  finish_readline_event ();
+  return true;
+}
+
+bool
+octave_debug_step_out_event::perform ()
+{
+  octave_value_list args;
+  args.append (octave_value ("out"));
+  call_octave_function ("dbstep", args);
+  finish_readline_event ();
+  return true;
+}
+
+
+bool
+octave_exit_event::perform ()
+{
+  clean_up_and_exit (0);
+  return true;
+}
+
+bool
+octave_run_file_event::perform ()
+{
+  octave_value_list args;
+  args.append (octave_value (_file));
+  call_octave_function ("run", args);
+  finish_readline_event ();
+  return true;
+}
+
+bool
+octave_change_directory_event::perform ()
+{
+  return octave_env::chdir (_directory);
+}
+
+bool
+octave_load_workspace_event::perform ()
+{
+  octave_value_list args;
+  args.append (octave_value (_file));
+  call_octave_function ("load", args);
+  return true;
+}
+
+bool
+octave_save_workspace_event::perform ()
+{
+  octave_value_list args;
+  args.append (octave_value (_file));
+  call_octave_function ("save", args);
+  return true;
+}
+
+bool
+octave_add_breakpoint_event::perform ()
+{
+  bp_table::intmap intmap;
+  intmap[0] = _line + 1;
+
+  std::string previous_directory = octave_env::get_current_directory ();
+  octave_env::chdir (_path);
+  intmap = bp_table::add_breakpoint (_function_name, intmap);
+  octave_env::chdir (previous_directory);
+  return intmap.size () > 0;
+}
+
+bool
+octave_remove_breakpoint_event::perform ()
+{
+  bp_table::intmap intmap;
+  intmap[0] = _line;
+
+  std::string previous_directory = octave_env::get_current_directory ();
+  octave_env::chdir (_path);
+  bp_table::remove_breakpoint (_function_name, intmap);
+  octave_env::chdir (previous_directory);
+  return true; // TODO: Check result.
+}
+
+bool
+octave_remove_all_breakpoints_event::perform ()
+{
+  bp_table::intmap intmap;
+  std::string previous_directory = octave_env::get_current_directory ();
+  octave_env::chdir (_path);
+  intmap = bp_table::remove_all_breakpoints_in_file (_function_name, true);
+  octave_env::chdir (previous_directory);
+  return intmap.size() > 0;
+}
--- a/gui/src/octave-adapter/octave-event.h	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/octave-adapter/octave-event.h	Sat Aug 11 11:02:12 2012 -0400
@@ -19,17 +19,10 @@
 #define OCTAVEEVENT_H
 
 #include <string>
+
+class octave_value_list;
+
 #include "octave-event-observer.h"
-#include "config.h"
-#include "symtab.h"
-#include "oct-env.h"
-#include "pt-eval.h"
-#include "toplev.h"
-#include "parse.h"
-#include "debug.h"
-#include "cmd-hist.h"
-
-#include <readline/readline.h>
 
 /**
   * \class octave_event
@@ -74,23 +67,13 @@
     { _octave_event_observer.event_reject (this); }
 
   protected:
+    void call_octave_function (std::string name);
+
     void call_octave_function (std::string name,
-                               const octave_value_list& args = octave_value_list (),
-                               int nargout = 0)
-    {
-      try
-      {
-        feval (name, args, nargout);
-      } catch (...) { } // Ignore exceptions. Crashes without that.
-    }
+                               const octave_value_list& args,
+                               int nargout = 0);
 
-    void finish_readline_event () const
-    {
-      rl_line_buffer[0] = '\0';
-      rl_point = rl_end = 0;
-      rl_done = 1;
-      //rl_forced_update_display ();
-    }
+    void finish_readline_event () const;
 
   private:
     octave_event_observer& _octave_event_observer;
@@ -129,8 +112,7 @@
       : octave_event (o)
     { }
 
-    bool perform ()
-    { clean_up_and_exit (0); return true; }
+    bool perform ();
 };
 
 /** Implements an octave run file event. */
@@ -143,14 +125,7 @@
       : octave_event (o)
     { _file = file; }
 
-    bool perform ()
-    {
-      octave_value_list args;
-      args.append (octave_value (_file));
-      call_octave_function ("run", args);
-      finish_readline_event ();
-      return true;
-    }
+    bool perform ();
 
   private:
     std::string _file;
@@ -166,8 +141,7 @@
       : octave_event (o)
     { _directory = directory; }
 
-    bool perform ()
-    { return octave_env::chdir (_directory); }
+    bool perform ();
 
   private:
     std::string _directory;
@@ -199,13 +173,7 @@
       : octave_event (o)
     { _file = file; }
 
-    bool perform ()
-    {
-      octave_value_list args;
-      args.append (octave_value (_file));
-      call_octave_function ("load", args);
-      return true;
-    }
+    bool perform ();
 
   private:
     std::string _file;
@@ -221,13 +189,7 @@
       : octave_event (o)
     { _file = file; }
 
-    bool perform ()
-    {
-      octave_value_list args;
-      args.append (octave_value (_file));
-      call_octave_function ("save", args);
-      return true;
-    }
+    bool perform ();
 
   private:
     std::string _file;
@@ -241,14 +203,7 @@
       : octave_event (o)
     { }
 
-    bool perform ()
-    {
-      int i;
-      while ((i = command_history::length ()) > 0) {
-          command_history::remove (i - 1);
-        }
-      return true;
-    }
+  bool perform ();
 };
 
 class octave_add_breakpoint_event : public octave_event
@@ -265,17 +220,7 @@
       _line = line;
     }
 
-    bool perform ()
-    {
-      bp_table::intmap intmap;
-      intmap[0] = _line + 1;
-
-      std::string previous_directory = octave_env::get_current_directory ();
-      octave_env::chdir (_path);
-      intmap = bp_table::add_breakpoint (_function_name, intmap);
-      octave_env::chdir (previous_directory);
-      return intmap.size () > 0;
-    }
+    bool perform ();
 
     std::string get_path ()
     {
@@ -312,17 +257,7 @@
       _line = line;
     }
 
-    bool perform ()
-    {
-      bp_table::intmap intmap;
-      intmap[0] = _line;
-
-      std::string previous_directory = octave_env::get_current_directory ();
-      octave_env::chdir (_path);
-      bp_table::remove_breakpoint (_function_name, intmap);
-      octave_env::chdir (previous_directory);
-      return true; // TODO: Check result.
-    }
+    bool perform ();
 
     std::string get_path ()
     {
@@ -357,15 +292,7 @@
       _function_name = function_name;
     }
 
-    bool perform ()
-    {
-      bp_table::intmap intmap;
-      std::string previous_directory = octave_env::get_current_directory ();
-      octave_env::chdir (_path);
-      intmap = bp_table::remove_all_breakpoints_in_file (_function_name, true);
-      octave_env::chdir (previous_directory);
-      return intmap.size() > 0;
-    }
+    bool perform ();
 
     std::string get_path ()
     {
@@ -389,14 +316,7 @@
     octave_debug_step_into_event (octave_event_observer& o)
       : octave_event (o) { }
 
-    bool perform ()
-    {
-      octave_value_list args;
-      args.append (octave_value ("in"));
-      call_octave_function ("dbstep", args);
-      finish_readline_event ();
-      return true;
-    }
+    bool perform ();
 };
 
 class octave_debug_step_over_event : public octave_event
@@ -421,14 +341,7 @@
     octave_debug_step_out_event (octave_event_observer& o)
       : octave_event (o) { }
 
-    bool perform ()
-    {
-      octave_value_list args;
-      args.append (octave_value ("out"));
-      call_octave_function ("dbstep", args);
-      finish_readline_event ();
-      return true;
-    }
+    bool perform ();
 };
 
 class octave_debug_continue_event : public octave_event
--- a/gui/src/octave-adapter/octave-link.cc	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/octave-adapter/octave-link.cc	Sat Aug 11 11:02:12 2012 -0400
@@ -15,8 +15,17 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "cmd-edit.h"
+#include "oct-env.h"
+#include "oct-mutex.h"
+#include "symtab.h"
+#include "toplev.h"
+
 #include "octave-link.h"
-#include "load-path.h"
 
 int octave_readline_hook ()
 {
--- a/gui/src/octave-adapter/octave-link.h	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/octave-adapter/octave-link.h	Sat Aug 11 11:02:12 2012 -0400
@@ -18,51 +18,10 @@
 #ifndef OCTAVELINK_H
 #define OCTAVELINK_H
 
-// Octave includes
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef PACKAGE_URL
-#include "config.h"
-#include "cmd-edit.h"
-#include "error.h"
-#include "file-io.h"
-#include "input.h"
-#include "lex.h"
-#include "load-path.h"
-#include "octave.h"
-#include "oct-hist.h"
-#include "oct-map.h"
-#include "oct-obj.h"
-#include "ops.h"
-#include "ov.h"
-#include "ov-usr-fcn.h"
-#include "symtab.h"
-#include "pt.h"
-#include "pt-eval.h"
-#include "config.h"
-#include "Range.h"
-#include "toplev.h"
-#include "procstream.h"
-#include "sighandlers.h"
-#include "debug.h"
-#include "sysdep.h"
-#include "ov.h"
-#include "unwind-prot.h"
-#include "utils.h"
-#include "variables.h"
-#include "oct-mutex.h"
-#include "profiler.h"
+#include <queue>
+#include <string>
 
-// Standard includes
-#include <iostream>
-#include <string>
-#include <vector>
-#include <readline/readline.h>
-#include <queue>
-#include <time.h>
+class octave_mutex;
 
 #include "octave-main-thread.h"
 #include "octave-event.h"
--- a/gui/src/octave-adapter/octave-main-thread.cc	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/octave-adapter/octave-main-thread.cc	Sat Aug 11 11:02:12 2012 -0400
@@ -15,9 +15,16 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string>
+
+#include "octave.h"
+
 #include "octave-main-thread.h"
 #include "octave-link.h"
-#include <string>
 
 octave_main_thread::octave_main_thread () : QThread ()
 {
--- a/gui/src/octave-gui.cc	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/octave-gui.cc	Sat Aug 11 11:02:12 2012 -0400
@@ -15,9 +15,18 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <QtGui/QApplication>
 #include <QTranslator>
 #include <QSettings>
+
+#include <iostream>
+
+#include <syswait.h>
+
 #include "welcome-wizard.h"
 #include "resource-manager.h"
 #include "main-window.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/symbol-information.cc	Sat Aug 11 11:02:12 2012 -0400
@@ -0,0 +1,100 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <QString>
+
+#include "ov.h"
+#include "symtab.h"
+
+#include "symbol-information.h"
+
+bool
+symbol_information::from_symbol_record
+  (const symbol_table::symbol_record& symbol_record)
+{
+  if (symbol_record.is_local () && !symbol_record.is_global () && !symbol_record.is_hidden ())
+    _scope = local;
+  else if (symbol_record.is_global ())
+    _scope = global;
+  else if (symbol_record.is_persistent ())
+    _scope = persistent;
+  else if (symbol_record.is_hidden ())
+    _scope = hidden;
+
+  _symbol = QString (symbol_record.name ().c_str ());
+  _type   = QString (symbol_record.varval ().type_name ().c_str ());
+  octave_value ov = symbol_record.varval ();
+
+  // In case we have really large matrices or strings, cut them down
+  // for performance reasons.
+  QString short_value_string;
+  bool use_short_value_string = false;
+  if (ov.is_matrix_type () || ov.is_cell ())
+    {
+      if (ov.rows () * ov.columns () > 10)
+        {
+          use_short_value_string = true;
+          short_value_string
+            = QString ("%1x%2 items").arg (ov.rows ()).arg (ov.columns ());
+        }
+    }
+  else if (ov.is_string ())
+    {
+      if (ov.string_value ().length () > 40)
+        {
+          use_short_value_string = true;
+          short_value_string
+            = QString::fromStdString (ov.string_value ().substr (0, 40));
+        }
+    }
+
+  if (use_short_value_string)
+    {
+      _value = short_value_string;
+    }
+  else
+    {
+      std::stringstream buffer;
+      ov.print (buffer, true);
+      _value  = QString::fromStdString (buffer.str ());
+    }
+  _value.replace("\n", " ");
+
+  if (ov.is_string ())
+    _dimension = QString ("%1").arg (ov.string_value ().length ());
+  else if (ov.is_range ())
+    _dimension =  QString ("%1 : %2 : %3").arg (ov.range_value ().base ())
+      .arg (ov.range_value ().inc ())
+      .arg (ov.range_value ().limit ());
+  else if (ov.is_matrix_type () || ov.is_cell ())
+    _dimension = QString ("%1x%2").arg (ov.rows ())
+      .arg (ov.columns ());
+  else if (ov.is_function_handle ())
+    // See code for func2str for a possible solution
+    _dimension = QString ("func handle");
+  else if (ov.is_inline_function ())
+    // See code for formula for a possible solution
+    _dimension = QString ("inline func");
+  else
+    _dimension = "1";
+
+  return true;
+}
--- a/gui/src/symbol-information.h	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/symbol-information.h	Sat Aug 11 11:02:12 2012 -0400
@@ -18,46 +18,18 @@
 #ifndef SYMBOLINFORMATION_H
 #define SYMBOLINFORMATION_H
 
+// FIXME -- we should not be including config.h in header files.
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <QString>
 #include <QHash>
 
 #include <sstream>
 
-// Octave includes
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef PACKAGE_URL
-#include "config.h"
-#include "cmd-edit.h"
-#include "error.h"
-#include "file-io.h"
-#include "input.h"
-#include "lex.h"
-#include "load-path.h"
-#include "octave.h"
-#include "oct-hist.h"
-#include "oct-map.h"
-#include "oct-obj.h"
-#include "ops.h"
-#include "ov.h"
-#include "ov-usr-fcn.h"
 #include "symtab.h"
-#include "pt.h"
-#include "pt-eval.h"
-#include "config.h"
-#include "Range.h"
-#include "toplev.h"
-#include "procstream.h"
-#include "sighandlers.h"
-#include "debug.h"
-#include "sysdep.h"
-#include "ov.h"
-#include "unwind-prot.h"
-#include "utils.h"
-#include "variables.h"
 
 /**
   * \struct symbol_information
@@ -68,7 +40,7 @@
   * about a symbol-table entry that will be used in the model for the
   * graphical user interface.
   */
-typedef struct symbol_information
+struct symbol_information
 {
   enum Scope
   {
@@ -108,76 +80,7 @@
 
   /** Extracts meta information from a given symbol record. */
   bool
-  from_symbol_record (const symbol_table::symbol_record& symbol_record)
-  {
-    if (symbol_record.is_local () && !symbol_record.is_global () && !symbol_record.is_hidden ())
-      _scope = local;
-    else if (symbol_record.is_global ())
-      _scope = global;
-    else if (symbol_record.is_persistent ())
-      _scope = persistent;
-    else if (symbol_record.is_hidden ())
-      _scope = hidden;
-
-    _symbol = QString (symbol_record.name ().c_str ());
-    _type   = QString (symbol_record.varval ().type_name ().c_str ());
-    octave_value ov = symbol_record.varval ();
-
-    // In case we have really large matrices or strings, cut them down
-    // for performance reasons.
-    QString short_value_string;
-    bool use_short_value_string = false;
-    if (ov.is_matrix_type () || ov.is_cell ())
-      {
-        if (ov.rows () * ov.columns () > 10)
-          {
-            use_short_value_string = true;
-            short_value_string
-              = QString ("%1x%2 items").arg (ov.rows ()).arg (ov.columns ());
-          }
-      }
-    else if (ov.is_string ())
-      {
-        if (ov.string_value ().length () > 40)
-          {
-            use_short_value_string = true;
-            short_value_string
-              = QString::fromStdString (ov.string_value ().substr (0, 40));
-          }
-      }
-
-    if (use_short_value_string)
-      {
-        _value = short_value_string;
-      }
-    else
-      {
-        std::stringstream buffer;
-        ov.print (buffer, true);
-        _value  = QString::fromStdString (buffer.str ());
-      }
-    _value.replace("\n", " ");
-
-    if (ov.is_string ())
-      _dimension = QString ("%1").arg (ov.string_value ().length ());
-    else if (ov.is_range ())
-      _dimension =  QString ("%1 : %2 : %3").arg (ov.range_value ().base ())
-                                            .arg (ov.range_value ().inc ())
-                                            .arg (ov.range_value ().limit ());
-    else if (ov.is_matrix_type () || ov.is_cell ())
-      _dimension = QString ("%1x%2").arg (ov.rows ())
-                                    .arg (ov.columns ());
-    else if (ov.is_function_handle ())
-      // See code for func2str for a possible solution
-      _dimension = QString ("func handle");
-    else if (ov.is_inline_function ())
-      // See code for formula for a possible solution
-      _dimension = QString ("inline func");
-    else
-      _dimension = "1";
-
-    return true;
-  }
-} symbol_information;
+  from_symbol_record (const symbol_table::symbol_record& symbol_record);
+};
 
 #endif // SYMBOLINFORMATION_H
--- a/gui/src/workspace-model.cc	Sat Aug 11 09:36:47 2012 -0400
+++ b/gui/src/workspace-model.cc	Sat Aug 11 11:02:12 2012 -0400
@@ -15,9 +15,18 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "workspace-model.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <QTreeWidget>
 #include <QTime>
+
+#include <list>
+
+#include <symtab.h>
+
+#include "workspace-model.h"
 #include "octave-link.h"
 
 workspace_model::workspace_model(QObject *parent)