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

Method addCheckSetSelection

plugins/clangtidy/config/checksetselectionlistmodel.cpp:187–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185
186
187int CheckSetSelectionListModel::addCheckSetSelection(const QString& name)
188{
189 const int newRow = m_checkSetSelections.count();
190 beginInsertRows(QModelIndex(), newRow, newRow);
191
192 CheckSetSelection checkSetSelection;
193 const QString id = QUuid::createUuid().toString();
194 checkSetSelection.setId(id);
195 checkSetSelection.setName(name);
196
197 const bool isNewDefault = m_checkSetSelections.isEmpty();
198 m_checkSetSelections.append(checkSetSelection);
199
200 m_added.append(id);
201 m_edited.insert(id);
202 if (isNewDefault) {
203 m_defaultChanged = true;
204 m_defaultCheckSetSelectionId = id;
205 }
206
207 endInsertRows();
208 if (isNewDefault) {
209 emit defaultCheckSetSelectionChanged(m_defaultCheckSetSelectionId);
210 }
211
212 return newRow;
213}
214
215int CheckSetSelectionListModel::cloneCheckSetSelection(const QString& name, int row)
216{

Callers

nothing calls this directly

Calls 8

QModelIndexClass · 0.50
countMethod · 0.45
toStringMethod · 0.45
setIdMethod · 0.45
setNameMethod · 0.45
isEmptyMethod · 0.45
appendMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected