Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gui/checkthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ void CheckThread::parseClangErrors(const QString &tool, const QString &file0, QS
{
QList<ErrorItem> errorItems;
ErrorItem errorItem;
const QRegularExpression r1("^(.+):([0-9]+):([0-9]+): (note|warning|error|fatal error): (.*)$");
const QRegularExpression r2("^(.*)\\[([a-zA-Z0-9\\-_\\.]+)\\]$");
static const QRegularExpression r1("^(.+):([0-9]+):([0-9]+): (note|warning|error|fatal error): (.*)$");
static const QRegularExpression r2("^(.*)\\[([a-zA-Z0-9\\-_\\.]+)\\]$");
QTextStream in(&err, QIODevice::ReadOnly);
while (!in.atEnd()) {
QString line = in.readLine();
Expand Down
2 changes: 1 addition & 1 deletion gui/libraryaddfunctiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LibraryAddFunctionDialog::LibraryAddFunctionDialog(QWidget *parent) :
mUi(new Ui::LibraryAddFunctionDialog)
{
mUi->setupUi(this);
const QRegularExpression rx(NAMES);
static const QRegularExpression rx(NAMES);
QValidator *validator = new QRegularExpressionValidator(rx, this);
mUi->functionName->setValidator(validator);
}
Expand Down
11 changes: 7 additions & 4 deletions gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ void MainWindow::handleCLIParams(const QStringList &params)
} else {
loadResults(logFile);
}
} else if ((index = params.indexOf(QRegularExpression(".*\\.cppcheck$", QRegularExpression::CaseInsensitiveOption), 0)) >= 0 && index < params.length() && QFile(params[index]).exists()) {
} else if ((index = params.indexOf(QRegularExpression(".*\\.cppcheck$", QRegularExpression::CaseInsensitiveOption))) >= 0 && index < params.length() && QFile(params[index]).exists()) {
loadProjectFile(params[index]);
} else if ((index = params.indexOf(QRegularExpression(".*\\.xml$", QRegularExpression::CaseInsensitiveOption), 0)) >= 0 && index < params.length() && QFile(params[index]).exists()) {
} else if ((index = params.indexOf(QRegularExpression(".*\\.xml$", QRegularExpression::CaseInsensitiveOption))) >= 0 && index < params.length() && QFile(params[index]).exists()) {
loadResults(params[index],QDir::currentPath());
} else
doAnalyzeFiles(params);
Expand Down Expand Up @@ -1142,8 +1142,11 @@ void MainWindow::clearResults()
if (mProjectFile && !mProjectFile->getBuildDir().isEmpty()) {
QDir dir(QFileInfo(mProjectFile->getFilename()).absolutePath() + '/' + mProjectFile->getBuildDir());
for (const QString& f: dir.entryList(QDir::Files)) {
if (!f.endsWith("files.txt") && !QRegularExpression("^.*.s[0-9]+$").match(f).hasMatch())
dir.remove(f);
if (!f.endsWith("files.txt")) {
static const QRegularExpression rx("^.*.s[0-9]+$");
if (!rx.match(f).hasMatch())
dir.remove(f);
}
}
}
mUI->mResults->clear(true);
Expand Down
2 changes: 1 addition & 1 deletion gui/statsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ QLineSeries *StatsDialog::numberOfReports(const QString &fileName, const QString
QTextStream in(&f);
while (!in.atEnd()) {
QString line = in.readLine();
const QRegularExpression rxdate("^\\[(\\d\\d)\\.(\\d\\d)\\.(\\d\\d\\d\\d)\\]$");
static const QRegularExpression rxdate("^\\[(\\d\\d)\\.(\\d\\d)\\.(\\d\\d\\d\\d)\\]$");
const QRegularExpressionMatch matchRes = rxdate.match(line);
if (matchRes.hasMatch()) {
int y = matchRes.captured(3).toInt();
Expand Down
5 changes: 4 additions & 1 deletion tools/triage/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ void MainWindow::load(QTextStream &textStream)
if (!errorMessage.isEmpty())
mAllErrors << errorMessage;
errorMessage.clear();
} else if (!url.isEmpty() && QRegularExpression("^.*: (error|warning|style|note):.*$").match(line).hasMatch()) {
} else if (!url.isEmpty()) {
static const QRegularExpression severityRe("^.*: (error|warning|style|note):.*$");
if (severityRe.match(line).hasMatch())
continue;
const QRegularExpressionMatch matchRes = mVersionRe.match(line);
if (matchRes.hasMatch()) {
const QString version = matchRes.captured(1);
Expand Down