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

Method removeCheckSetSelection

plugins/clazy/config/checksetselectionlistmodel.cpp:236–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void CheckSetSelectionListModel::removeCheckSetSelection(int row)
237{
238 if ((row < 0) || m_checkSetSelections.count() <= row) {
239 return;
240 }
241
242 beginRemoveRows(QModelIndex(), row, row);
243
244 const QString id = m_checkSetSelections.at(row).id();
245
246 m_checkSetSelections.removeAt(row);
247
248 m_edited.remove(id);
249 if (!m_added.removeOne(id)) {
250 m_removed.append(id);
251 }
252
253 endRemoveRows();
254
255 // set new default if this was the default before
256 if (id == m_defaultCheckSetSelectionId) {
257 if (m_checkSetSelections.isEmpty()) {
258 m_defaultChanged = true;
259 m_defaultCheckSetSelectionId.clear();
260 emit defaultCheckSetSelectionChanged(m_defaultCheckSetSelectionId);
261 } else {
262 setDefaultCheckSetSelection(0);
263 }
264 }
265}
266
267void CheckSetSelectionListModel::setDefaultCheckSetSelection(int row)
268{

Callers 1

Calls 9

removeOneMethod · 0.80
QModelIndexClass · 0.50
countMethod · 0.45
idMethod · 0.45
atMethod · 0.45
removeMethod · 0.45
appendMethod · 0.45
isEmptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected