changeset 27192:8779c631d55f

fix access to top_level info flag when creating workspace view context menu * workspace-view.cc (workspace_view::contextmenu_requested): Use m_model to access top_level info flag.
author John W. Eaton <jwe@octave.org>
date Wed, 19 Jun 2019 21:32:22 -0500
parents 0ad2ff3a3a6e
children 01e73e1664ff
files libgui/src/workspace-view.cc
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/workspace-view.cc	Wed Jun 19 12:12:15 2019 -0500
+++ b/libgui/src/workspace-view.cc	Wed Jun 19 21:32:22 2019 -0500
@@ -357,10 +357,9 @@
         QAction *rename = menu.addAction (tr ("Rename"), this,
                                           SLOT (handle_contextmenu_rename ()));
 
-        QAbstractItemModel *m = m_view->model ();
-        const workspace_model *wm = static_cast<const workspace_model *> (m);
-
-        if (! wm->is_top_level ())
+        // Use m_model here instead of using "m_view->model ()" because
+        // that points to the proxy model.
+        if (! m_model->is_top_level ())
           {
             rename->setDisabled (true);
             rename->setToolTip (tr ("Only top-level symbols may be renamed"));