MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / adjustNameForParentIndex

Method adjustNameForParentIndex

src/document/UBDocumentController.cpp:1375–1385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1373}
1374
1375QString UBDocumentTreeModel::adjustNameForParentIndex(const QString &pName, const QModelIndex &pIndex)
1376{
1377 int i = 0;
1378 QString newName = pName;
1379 QStringList siblingNames = nodeNameList(pIndex);
1380 while (siblingNames.contains(newName)) {
1381 newName = pName + " " + QVariant(++i).toString();
1382 }
1383
1384 return newName;
1385}
1386
1387void UBDocumentTreeModel::fixNodeName(const QModelIndex &source, const QModelIndex &dest)
1388{

Callers 2

createNewDocumentMethod · 0.80

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected