diff libgui/src/workspace-view.h @ 16445:3f8d3fc907af

store workspace model in main_window, not in workspace view * main-window.h, main-window.cc (main_window::_workspace_model): New data member. (main_window::construct): Create _workspace_model and make it the model for _workspace_view. connect _workspace_model::model_changed to _workspace_view::model_changed. (main_window::~main_window): Delete _workspace_model. * workspace-view.h, workspace-view.cc (workspace_view::_workspace_model): Delete. Use model() method to get model where needed. (workspace_view::setModel): New function. (workspace_view::view): Rename from _workspace_tree_view. Change all uses. (workspace_view::workspace_view): Don't connect _workspace_model::model_changed signal to workspace_view::model_changed here.
author John W. Eaton <jwe@octave.org>
date Sat, 06 Apr 2013 14:23:52 -0400
parents bbbb89cc338f
children cbc39a3d0c42
line wrap: on
line diff
--- a/libgui/src/workspace-view.h	Sat Apr 06 14:01:58 2013 -0400
+++ b/libgui/src/workspace-view.h	Sat Apr 06 14:23:52 2013 -0400
@@ -36,6 +36,10 @@
   workspace_view (QWidget * parent = 0);
   ~workspace_view ();
 
+public:
+
+  void setModel (workspace_model *model) { view->setModel (model); }
+
 public slots:
   void handle_visibility_changed (bool visible);
   void model_changed ();
@@ -55,10 +59,7 @@
   void item_double_clicked (QModelIndex index);
 
 private:
-  QTreeView *_workspace_tree_view;
-
-  /** Stores the current workspace model. */
-  workspace_model *_workspace_model;
+  QTreeView *view;
 
   struct
   {