| 350 | } |
| 351 | |
| 352 | void MainWindow::handleCLIParams(const QStringList ¶ms) |
| 353 | { |
| 354 | int index; |
| 355 | if (params.contains("-p")) { |
| 356 | index = params.indexOf("-p"); |
| 357 | if ((index + 1) < params.length()) |
| 358 | loadProjectFile(params[index + 1]); |
| 359 | } else if (params.contains("-l")) { |
| 360 | QString logFile; |
| 361 | index = params.indexOf("-l"); |
| 362 | if ((index + 1) < params.length()) |
| 363 | logFile = params[index + 1]; |
| 364 | |
| 365 | if (params.contains("-d")) { |
| 366 | QString checkedDir; |
| 367 | index = params.indexOf("-d"); |
| 368 | if ((index + 1) < params.length()) |
| 369 | checkedDir = params[index + 1]; |
| 370 | |
| 371 | loadResults(logFile, checkedDir); |
| 372 | } else { |
| 373 | loadResults(logFile); |
| 374 | } |
| 375 | } else if ((index = params.indexOf(QRegularExpression(".*\\.cppcheck$", QRegularExpression::CaseInsensitiveOption))) >= 0 && index < params.length() && QFile(params[index]).exists()) { |
| 376 | loadProjectFile(params[index]); |
| 377 | } else if ((index = params.indexOf(QRegularExpression(".*\\.xml$", QRegularExpression::CaseInsensitiveOption))) >= 0 && index < params.length() && QFile(params[index]).exists()) { |
| 378 | loadResults(params[index],QDir::currentPath()); |
| 379 | } else |
| 380 | doAnalyzeFiles(params); |
| 381 | } |
| 382 | |
| 383 | void MainWindow::loadSettings() |
| 384 | { |