Fixed #3192 (GUI: Allow opening project file without extra parameter from CLI)
This commit is contained in:
parent
34449ae857
commit
0886ef9c5f
|
@ -214,21 +214,26 @@ MainWindow::~MainWindow()
|
||||||
|
|
||||||
void MainWindow::HandleCLIParams(const QStringList ¶ms)
|
void MainWindow::HandleCLIParams(const QStringList ¶ms)
|
||||||
{
|
{
|
||||||
|
int index;
|
||||||
if (params.contains("-p")) {
|
if (params.contains("-p")) {
|
||||||
const int ind = params.indexOf("-p");
|
index = params.indexOf("-p");
|
||||||
if ((ind + 1) < params.length())
|
if ((index + 1) < params.length())
|
||||||
LoadProjectFile(params[ind + 1]);
|
LoadProjectFile(params[index + 1]);
|
||||||
|
} else if ((index = params.indexOf(QRegExp(".*\\.cppcheck$", Qt::CaseInsensitive), 0)) >= 0 && index < params.length() && QFile(params[index]).exists()) {
|
||||||
|
LoadProjectFile(params[index]);
|
||||||
|
} else if ((index = params.indexOf(QRegExp(".*\\.xml$", Qt::CaseInsensitive), 0)) >= 0 && index < params.length() && QFile(params[index]).exists()) {
|
||||||
|
LoadResults(params[index]);
|
||||||
} else if (params.contains("-l")) {
|
} else if (params.contains("-l")) {
|
||||||
QString logFile;
|
QString logFile;
|
||||||
const int ind = params.indexOf("-l");
|
index = params.indexOf("-l");
|
||||||
if ((ind + 1) < params.length())
|
if ((index + 1) < params.length())
|
||||||
logFile = params[ind + 1];
|
logFile = params[index + 1];
|
||||||
|
|
||||||
if (params.contains("-d")) {
|
if (params.contains("-d")) {
|
||||||
QString checkedDir;
|
QString checkedDir;
|
||||||
const int ind = params.indexOf("-d");
|
index = params.indexOf("-d");
|
||||||
if ((ind + 1) < params.length())
|
if ((index + 1) < params.length())
|
||||||
checkedDir = params[ind + 1];
|
checkedDir = params[index + 1];
|
||||||
|
|
||||||
LoadResults(logFile, checkedDir);
|
LoadResults(logFile, checkedDir);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue