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

Method parseReportFromFile

src/plugins/codeporting/codeporting.cpp:208–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208bool CodePorting::parseReportFromFile(const QString &reportPath)
209{
210 bool successful = false;
211
212 bool isReportExists = QFile::exists(reportPath);
213 qInfo() << "Report exists: " << isReportExists;
214
215 if (isReportExists) {
216 QFile file(reportPath);
217 if (file.open(QIODevice::ReadOnly)) {
218 report.clear();
219 const char *quotes = "\"";
220 while (!file.atEnd()) {
221 QString line = file.readLine();
222 QStringList cols = line.split("\",\"");
223 if (cols.length() == kItemsCount) {
224 // remove redundant quotes
225 cols.first().remove(quotes);
226 cols.last().remove(quotes);
227
228 QString type = cols[kFileType].simplified();
229 if (report.find(type) == report.end()) {
230 report.insert(type, {cols});
231 } else {
232 report[type].push_back(cols);
233 }
234 }
235 }
236 file.close();
237 successful = true;
238 }
239 }
240 return successful;
241}
242
243QString CodePorting::parseReportPath(const QString &line)
244{

Callers

nothing calls this directly

Calls 10

atEndMethod · 0.80
insertMethod · 0.80
openMethod · 0.45
clearMethod · 0.45
readLineMethod · 0.45
lengthMethod · 0.45
removeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected