Mercurial > hg > octave-lojdl
changeset 16527:8701792e16ec
include column in workspace viewer for storage class
* workspace-model.cc (workspace_model::workspace_model): New column in
for storage class.
(workspace_model::data): Set values for storage class column.
(symbol_table::do_workspace_info): Also insert a tag in storage for
automatic, formal, hidden, and inherited storage classes.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 16 Apr 2013 16:56:40 -0400 |
parents | 01541f7321f7 |
children | 9bc1f8278966 |
files | libgui/src/workspace-model.cc libinterp/interpfcn/symtab.cc |
diffstat | 2 files changed, 27 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/workspace-model.cc +++ b/libgui/src/workspace-model.cc @@ -38,6 +38,7 @@ _columnNames.append (tr ("Class")); _columnNames.append (tr ("Dimension")); _columnNames.append (tr ("Value")); + _columnNames.append (tr ("Storage Class")); } int @@ -109,6 +110,24 @@ retval = QVariant (_values[idx.row()]); break; + case 4: + { + QChar c = _scopes[idx.row()]; + + if (c == 'g') + retval = QVariant (tr ("global")); + else if (c == 'p') + retval = QVariant (tr ("persistent")); + else if (c == 'a') + retval = QVariant (tr ("automatic")); + else if (c == 'f') + retval = QVariant (tr ("function parameter")); + else if (c == 'h') + retval = QVariant (tr ("hidden")); + else if (c == 'i') + retval = QVariant (tr ("inherited")); + } + default: break; }
--- a/libinterp/interpfcn/symtab.cc +++ b/libinterp/interpfcn/symtab.cc @@ -1403,6 +1403,14 @@ storage = 'g'; else if (sr.is_persistent ()) storage = 'p'; + else if (sr.is_automatic ()) + storage = 'a'; + else if (sr.is_formal ()) + storage = 'f'; + else if (sr.is_hidden ()) + storage = 'h'; + else if (sr.is_inherited ()) + storage = 'i'; workspace_element elt (storage, nm, val.class_name (), val.short_disp (), dv.str ());