forked from qt-creator/qt-creator
Debugger: Use QRegularExpression in QmlInspector
Change-Id: Ib359738c07a5531fe66656bce5ad42c39e4a9ab2 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#include <QElapsedTimer>
|
||||
#include <QFileInfo>
|
||||
#include <QLoggingCategory>
|
||||
#include <QRegularExpression>
|
||||
|
||||
using namespace QmlDebug;
|
||||
using namespace QmlDebug::Constants;
|
||||
@@ -555,10 +556,11 @@ void QmlInspectorAgent::buildDebugIdHashRecursive(const ObjectReference &ref)
|
||||
|
||||
// handle the case where the url contains the revision number encoded.
|
||||
// (for object created by the debugger)
|
||||
static QRegExp rx("(.*)_(\\d+):(\\d+)$");
|
||||
if (rx.exactMatch(fileUrl.path())) {
|
||||
fileUrl.setPath(rx.cap(1));
|
||||
lineNum += rx.cap(3).toInt() - 1;
|
||||
const QRegularExpression rx("^(.*)_(\\d+):(\\d+)$");
|
||||
const QRegularExpressionMatch match = rx.match(fileUrl.path());
|
||||
if (match.hasMatch()) {
|
||||
fileUrl.setPath(match.captured(1));
|
||||
lineNum += match.captured(3).toInt() - 1;
|
||||
}
|
||||
|
||||
const QString filePath = m_qmlEngine->toFileInProject(fileUrl);
|
||||
|
Reference in New Issue
Block a user