| 206 | } |
| 207 | |
| 208 | bool 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 | |
| 243 | QString CodePorting::parseReportPath(const QString &line) |
| 244 | { |