Skip to content
Snippets Groups Projects
Commit 00a97664 authored by Kai Koehne's avatar Kai Koehne
Browse files

DebugHelpers: Use static QRegExp for performance reasons

Reviewed-by: Bill King
parent 424fcf8c
No related branches found
No related tags found
No related merge requests found
...@@ -90,10 +90,12 @@ QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath) ...@@ -90,10 +90,12 @@ QString BuildableHelperLibrary::qtVersionForQMake(const QString &qmakePath)
return QString(); return QString();
} }
const QString output = QString::fromLocal8Bit(qmake.readAllStandardOutput()); const QString output = QString::fromLocal8Bit(qmake.readAllStandardOutput());
QRegExp regexp(QLatin1String("(QMake version|QMake version:)[\\s]*([\\d.]*)"), Qt::CaseInsensitive); static QRegExp regexp(QLatin1String("(QMake version|QMake version:)[\\s]*([\\d.]*)"),
Qt::CaseInsensitive);
regexp.indexIn(output); regexp.indexIn(output);
if (regexp.cap(2).startsWith(QLatin1String("2."))) { if (regexp.cap(2).startsWith(QLatin1String("2."))) {
QRegExp regexp2(QLatin1String("Using Qt version[\\s]*([\\d\\.]*)"), Qt::CaseInsensitive); static QRegExp regexp2(QLatin1String("Using Qt version[\\s]*([\\d\\.]*)"),
Qt::CaseInsensitive);
regexp2.indexIn(output); regexp2.indexIn(output);
const QString version = regexp2.cap(1); const QString version = regexp2.cap(1);
return version; return version;
...@@ -108,7 +110,7 @@ bool BuildableHelperLibrary::checkMinimumQtVersion(const QString &qtVersionStrin ...@@ -108,7 +110,7 @@ bool BuildableHelperLibrary::checkMinimumQtVersion(const QString &qtVersionStrin
int patch = -1; int patch = -1;
// check format // check format
QRegExp qtVersionRegex(QLatin1String("^\\d+\\.\\d+\\.\\d+$")); static QRegExp qtVersionRegex(QLatin1String("^\\d+\\.\\d+\\.\\d+$"));
if (!qtVersionRegex.exactMatch(qtVersionString)) if (!qtVersionRegex.exactMatch(qtVersionString))
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment