aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/qml/qmlinspectoragent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/debugger/qml/qmlinspectoragent.cpp')
-rw-r--r--src/plugins/debugger/qml/qmlinspectoragent.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp
index 580a4c3bd4..4558c7fdd0 100644
--- a/src/plugins/debugger/qml/qmlinspectoragent.cpp
+++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp
@@ -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);
@@ -709,10 +711,10 @@ void QmlInspectorAgent::toolsClientStateChanged(QmlDebugClient::State state)
if (state == QmlDebugClient::Enabled) {
Core::ICore::addAdditionalContext(m_inspectorToolsContext);
Core::ActionManager::registerAction(m_selectAction,
- Core::Id(Constants::QML_SELECTTOOL),
+ Utils::Id(Constants::QML_SELECTTOOL),
m_inspectorToolsContext);
Core::ActionManager::registerAction(m_showAppOnTopAction,
- Core::Id(Constants::QML_SHOW_APP_ON_TOP),
+ Utils::Id(Constants::QML_SHOW_APP_ON_TOP),
m_inspectorToolsContext);
enableTools(m_qmlEngine->state() == InferiorRunOk);
@@ -721,9 +723,9 @@ void QmlInspectorAgent::toolsClientStateChanged(QmlDebugClient::State state)
} else {
enableTools(false);
- Core::ActionManager::unregisterAction(m_selectAction, Core::Id(Constants::QML_SELECTTOOL));
+ Core::ActionManager::unregisterAction(m_selectAction, Utils::Id(Constants::QML_SELECTTOOL));
Core::ActionManager::unregisterAction(m_showAppOnTopAction,
- Core::Id(Constants::QML_SHOW_APP_ON_TOP));
+ Utils::Id(Constants::QML_SHOW_APP_ON_TOP));
Core::ICore::removeAdditionalContext(m_inspectorToolsContext);
}
}