| 1306 | } |
| 1307 | |
| 1308 | QModelIndex 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 | |
| 1325 | void UBDocumentTreeModel::setNewName(const QModelIndex &index, const QString &newName) |
| 1326 | { |
no test coverage detected