| 119 | } |
| 120 | |
| 121 | void EnvironmentProfileModel::addVariable(const QString& variableName, const QString& value) |
| 122 | { |
| 123 | if (m_currentProfileName.isEmpty()) { |
| 124 | return; |
| 125 | } |
| 126 | |
| 127 | const int pos = m_varsByIndex.indexOf(variableName); |
| 128 | if (pos != -1) { |
| 129 | return; // No duplicates, first value |
| 130 | } |
| 131 | |
| 132 | auto& variables = m_profileListModel->variables(m_currentProfileName); |
| 133 | |
| 134 | const int insertPos = rowCount(); |
| 135 | beginInsertRows(QModelIndex(), insertPos, insertPos); |
| 136 | m_varsByIndex << variableName; |
| 137 | variables.insert(variableName, value); |
| 138 | endInsertRows(); |
| 139 | } |
| 140 | |
| 141 | void EnvironmentProfileModel::removeVariables(const QStringList& variableNames) |
| 142 | { |
no test coverage detected