MCPcopy Create free account
hub / github.com/KDE/kdevelop / addVariable

Method addVariable

kdevplatform/shell/settings/environmentprofilemodel.cpp:121–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void 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
141void EnvironmentProfileModel::removeVariables(const QStringList& variableNames)
142{

Callers 1

onVariableInsertedMethod · 0.45

Calls 5

QModelIndexClass · 0.70
isEmptyMethod · 0.45
indexOfMethod · 0.45
variablesMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected