Skip to content
Snippets Groups Projects
Commit b9efb809 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Add some comments to environmentmodel::data()

Reviewed-by: dt
parent dfad3fa7
No related branches found
No related tags found
No related merge requests found
......@@ -103,13 +103,14 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
if (!index.isValid())
return QVariant();
if ((role == Qt::DisplayRole || role == Qt::EditRole)) {
if (role == Qt::DisplayRole || role == Qt::EditRole) {
if (index.column() == 0) {
return m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row());
} else if (index.column() == 1) {
// Do not return "<UNSET>" when editing a previously unset variable:
if (role == Qt::EditRole) {
int pos = findInChanges(indexToVariable(index));
if (pos != -1)
if (pos >= 0)
return m_items.at(pos).value;
}
return m_resultEnvironment.value(m_resultEnvironment.constBegin() + index.row());
......@@ -127,7 +128,6 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
return QVariant();
}
Qt::ItemFlags EnvironmentModel::flags(const QModelIndex &index) const
{
Q_UNUSED(index)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment