diff options
author | Samuel Gaist <samuel.gaist@edeltech.ch> | 2017-02-17 00:11:12 +0100 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@edeltech.ch> | 2017-04-09 22:17:20 +0000 |
commit | 70a5d7bd8755c84425f473585bb05376360e6b4e (patch) | |
tree | 2a07efc773524e0251982ae878be607a8e8f7f5a /tools/qmlprofiler | |
parent | cf059f045e5558231fe12607659fc67bd2259389 (diff) |
Migrate to QRegularExpression
This patch updates the code base to use QRegularExpression in the place
of the deprecated QRegExp class.
Change-Id: I3231ac9f7902a1cd16cd4ef5f26e6cdc05e2fa4b
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'tools/qmlprofiler')
-rw-r--r-- | tools/qmlprofiler/qmlprofilerdata.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/qmlprofiler/qmlprofilerdata.cpp b/tools/qmlprofiler/qmlprofilerdata.cpp index 596ad8d47f..bcda0bb7fe 100644 --- a/tools/qmlprofiler/qmlprofilerdata.cpp +++ b/tools/qmlprofiler/qmlprofilerdata.cpp @@ -33,7 +33,7 @@ #include <QHash> #include <QFile> #include <QXmlStreamReader> -#include <QRegExp> +#include <QRegularExpression> #include <limits> @@ -232,10 +232,10 @@ void QmlProfilerData::addQmlEvent(QQmlProfilerDefinitions::RangeType type, if (!data.isEmpty()) { details = data.join(QLatin1Char(' ')).replace( QLatin1Char('\n'), QLatin1Char(' ')).simplified(); - QRegExp rewrite(QStringLiteral("\\(function \\$(\\w+)\\(\\) \\{ (return |)(.+) \\}\\)")); - bool match = rewrite.exactMatch(details); - if (match) { - details = rewrite.cap(1) +QLatin1String(": ") + rewrite.cap(3); + QRegularExpression rewrite(QStringLiteral("^\\(function \\$(\\w+)\\(\\) \\{ (return |)(.+) \\}\\)$")); + QRegularExpressionMatch match = rewrite.match(details); + if (match.hasMatch()) { + details = match.captured(1) +QLatin1String(": ") + match.captured(3); } if (details.startsWith(QLatin1String("file://"))) details = details.mid(details.lastIndexOf(QLatin1Char('/')) + 1); |