Mercurial > octave
diff libgui/src/workspace-view.h @ 24648:1f1ac73910ab
respect sorting in variable editor (bug #51843)
* workspace-view.h, workspace-view.cc
(workspace_view::handle_contextmenu_edit): Use get_var_name to access
variable name through sort model proxy pointer instead of accessing
through m_model pointer.
(workspace_view::get_var_name): Pass arg by const reference instead of
value.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 29 Jan 2018 08:51:47 -0500 |
parents | f61502510d08 |
children | 08c92c9d48e3 |
line wrap: on
line diff
--- a/libgui/src/workspace-view.h Sun Jan 28 10:05:45 2018 +0100 +++ b/libgui/src/workspace-view.h Mon Jan 29 08:51:47 2018 -0500 @@ -99,10 +99,14 @@ void relay_contextmenu_command (const QString& cmdname); - QString get_var_name (QModelIndex index); + QString get_var_name (const QModelIndex& index); QTableView *m_view; int m_view_previous_row_count; + + // We are using a sort model proxy so m_model won't provide the + // correct ordering. It is still OK to use this pointer to access + // other info attached to the model, for example the scope or colors. workspace_model *m_model; QSortFilterProxyModel m_filter_model;