MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / handleCLIParams

Method handleCLIParams

gui/mainwindow.cpp:352–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352void MainWindow::handleCLIParams(const QStringList &params)
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
383void MainWindow::loadSettings()
384{

Callers

nothing calls this directly

Calls 2

containsMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected