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

Method nodeNameList

src/document/UBDocumentController.cpp:1166–1195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1164}
1165
1166QStringList UBDocumentTreeModel::nodeNameList(const QModelIndex &pIndex, bool distinctNodeType) const
1167{
1168 QStringList result;
1169
1170 UBDocumentTreeNode *catalog = nodeFromIndex(pIndex);
1171 if (catalog->nodeType() != UBDocumentTreeNode::Catalog) {
1172 return QStringList();
1173 }
1174
1175 foreach (UBDocumentTreeNode *curNode, catalog->children())
1176 {
1177 if (distinctNodeType)
1178 {
1179 if (curNode->nodeType() == UBDocumentTreeNode::Catalog)
1180 {
1181 result << "folder - " + curNode->nodeName();
1182 }
1183 else
1184 {
1185 result << curNode->nodeName();
1186 }
1187 }
1188 else
1189 {
1190 result << curNode->nodeName();
1191 }
1192 }
1193
1194 return result;
1195}
1196
1197bool UBDocumentTreeModel::newNodeAllowed(const QModelIndex &pSelectedIndex) const
1198{

Callers 2

createEditorMethod · 0.80

Calls 4

nodeTypeMethod · 0.80
childrenMethod · 0.80
nodeNameMethod · 0.80
foreachFunction · 0.70

Tested by

no test coverage detected