Mercurial > octave
changeset 24675:1c1789fa5d89
remove accidental change in variable editor model
* variab-editor-model.cc (variable_editor_model::flags):
Restore code commented out for debugging. Update coding style.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 02 Feb 2018 14:47:18 -0500 |
parents | 4f8edc1b0f18 |
children | b5dbcfa1e3e7 |
files | libgui/src/variable-editor-model.cc |
diffstat | 1 files changed, 8 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/variable-editor-model.cc Fri Feb 02 14:44:40 2018 -0500 +++ b/libgui/src/variable-editor-model.cc Fri Feb 02 14:47:18 2018 -0500 @@ -689,19 +689,15 @@ Qt::ItemFlags variable_editor_model::flags (const QModelIndex& idx) const { - if (m_d->m_validity) - { -#if 0 - if (requires_sub_editor (idx)) - { - if (editor_type (idx) != sub_string) - return QAbstractTableModel::flags (idx); - } -#endif - return QAbstractTableModel::flags (idx) | Qt::ItemIsEditable; - } + if (! m_d->m_validity) + return Qt::NoItemFlags; + + Qt::ItemFlags retval = QAbstractTableModel::flags (idx); - return Qt::NoItemFlags; + if (! requires_sub_editor (idx)) + retval |= Qt::ItemIsEditable; + + return retval; } bool