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

Method createFileNodes

src/plugins/smartut/gui/smartutwidget.cpp:168–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168std::vector<std::unique_ptr<FileNode>> SmartUTWidget::createFileNodes(const QString &workspace, const QStringList &fileList)
169{
170 auto setting = SmartUTManager::instance()->utSetting();
171 const auto &target = settingDlg->targetLocation();
172 const auto &nameFormat = setting->value(kGeneralGroup, kNameFormat).toString();
173 QSet<QString> utFileCache;
174 std::vector<std::unique_ptr<FileNode>> fileNodes;
175 for (const auto &f : fileList) {
176 if (!Utils::isCppFile(f) && !Utils::isCMakeFile(f))
177 continue;
178
179 const auto &utFile = Utils::createUTFile(workspace, f, target, nameFormat);
180 if (utFileCache.contains(utFile))
181 continue;
182
183 const auto &relatedFiles = Utils::relateFileList(f);
184 if (relatedFiles.isEmpty())
185 continue;
186
187 auto fileNode = std::make_unique<FileNode>(utFile);
188 fileNode->setSourceFiles(relatedFiles);
189 utFileCache.insert(utFile);
190 fileNodes.emplace_back(std::move(fileNode));
191 }
192
193 return fileNodes;
194}
195
196bool SmartUTWidget::checkModelValid()
197{

Callers

nothing calls this directly

Calls 8

utSettingMethod · 0.80
setSourceFilesMethod · 0.80
insertMethod · 0.80
targetLocationMethod · 0.45
toStringMethod · 0.45
valueMethod · 0.45
containsMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected