| 166 | } |
| 167 | |
| 168 | std::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 | |
| 196 | bool SmartUTWidget::checkModelValid() |
| 197 | { |
nothing calls this directly
no test coverage detected