MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / createProjectNode

Method createProjectNode

src/plugins/smartut/utils/utils.cpp:15–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include <QRegularExpression>
14
15ProjectNode *Utils::createProjectNode(const dpfservice::ProjectInfo &info)
16{
17 if (info.isEmpty())
18 return nullptr;
19
20 ProjectNode *prjNode = new ProjectNode(info.workspaceFolder());
21 std::vector<std::unique_ptr<FileNode>> sourceNodes;
22 const auto &sources = info.sourceFiles();
23 std::transform(sources.cbegin(), sources.cend(), std::back_inserter(sourceNodes),
24 [](const QString &f) {
25 return std::make_unique<FileNode>(f);
26 });
27 if (!sourceNodes.empty())
28 prjNode->addNestedNodes(std::move(sourceNodes), info.workspaceFolder());
29
30 return prjNode;
31}
32
33FolderNode *Utils::recursiveFindOrCreateFolderNode(FolderNode *folder,
34 const QString &directory,

Callers

nothing calls this directly

Calls 6

sourceFilesMethod · 0.80
cbeginMethod · 0.80
cendMethod · 0.80
addNestedNodesMethod · 0.80
isEmptyMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected