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

Method addCatalog

src/document/UBDocumentController.cpp:1308–1323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1306}
1307
1308QModelIndex UBDocumentTreeModel::addCatalog(const QString &pName, const QModelIndex &pParent)
1309{
1310 if (pName.isEmpty() || !pParent.isValid()) {
1311 return QModelIndex();
1312 }
1313
1314 UBDocumentTreeNode *catalogNode = new UBDocumentTreeNode(UBDocumentTreeNode::Catalog, pName);
1315 QModelIndex index = addNode(catalogNode, pParent);
1316
1317 if (!index.isValid())
1318 {
1319 delete catalogNode;
1320 }
1321
1322 return index;
1323}
1324
1325void UBDocumentTreeModel::setNewName(const QModelIndex &index, const QString &newName)
1326{

Callers 1

Calls 2

isEmptyMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected